OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/input/browser_controls_offset_manager.h" | 5 #include "cc/input/browser_controls_offset_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 : host_impl_(&task_runner_provider_, | 32 : host_impl_(&task_runner_provider_, |
33 &task_graph_runner_), | 33 &task_graph_runner_), |
34 redraw_needed_(false), | 34 redraw_needed_(false), |
35 update_draw_properties_needed_(false), | 35 update_draw_properties_needed_(false), |
36 bottom_controls_height_(0.f), | 36 bottom_controls_height_(0.f), |
37 top_controls_shown_ratio_(1.f), | 37 top_controls_shown_ratio_(1.f), |
38 top_controls_height_(top_controls_height), | 38 top_controls_height_(top_controls_height), |
39 browser_controls_show_threshold_(browser_controls_show_threshold), | 39 browser_controls_show_threshold_(browser_controls_show_threshold), |
40 browser_controls_hide_threshold_(browser_controls_hide_threshold) { | 40 browser_controls_hide_threshold_(browser_controls_hide_threshold) { |
41 active_tree_ = base::MakeUnique<LayerTreeImpl>( | 41 active_tree_ = base::MakeUnique<LayerTreeImpl>( |
42 &host_impl_, new SyncedProperty<ScaleGroup>, new SyncedBrowserControls, | 42 &host_impl_, new SyncedProperty<ScaleGroup>, |
| 43 new SyncedProperty<ScaleGroup>, new SyncedBrowserControls, |
43 new SyncedElasticOverscroll); | 44 new SyncedElasticOverscroll); |
44 root_scroll_layer_ = LayerImpl::Create(active_tree_.get(), 1); | 45 root_scroll_layer_ = LayerImpl::Create(active_tree_.get(), 1); |
45 } | 46 } |
46 | 47 |
47 ~MockBrowserControlsOffsetManagerClient() override {} | 48 ~MockBrowserControlsOffsetManagerClient() override {} |
48 | 49 |
49 void DidChangeBrowserControlsPosition() override { | 50 void DidChangeBrowserControlsPosition() override { |
50 redraw_needed_ = true; | 51 redraw_needed_ = true; |
51 update_draw_properties_needed_ = true; | 52 update_draw_properties_needed_ = true; |
52 } | 53 } |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 EXPECT_TRUE(manager->has_animation()); | 546 EXPECT_TRUE(manager->has_animation()); |
546 EXPECT_FLOAT_EQ(1.f, client.CurrentBrowserControlsShownRatio()); | 547 EXPECT_FLOAT_EQ(1.f, client.CurrentBrowserControlsShownRatio()); |
547 | 548 |
548 manager->UpdateBrowserControlsState(BOTH, SHOWN, true); | 549 manager->UpdateBrowserControlsState(BOTH, SHOWN, true); |
549 EXPECT_FALSE(manager->has_animation()); | 550 EXPECT_FALSE(manager->has_animation()); |
550 EXPECT_FLOAT_EQ(1.f, client.CurrentBrowserControlsShownRatio()); | 551 EXPECT_FLOAT_EQ(1.f, client.CurrentBrowserControlsShownRatio()); |
551 } | 552 } |
552 | 553 |
553 } // namespace | 554 } // namespace |
554 } // namespace cc | 555 } // namespace cc |
OLD | NEW |