| 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/top_controls_manager.h" | 5 #include "cc/input/top_controls_manager.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "cc/input/top_controls_manager_client.h" | 9 #include "cc/input/top_controls_manager_client.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 float top_controls_show_threshold, | 25 float top_controls_show_threshold, |
| 26 float top_controls_hide_threshold) | 26 float top_controls_hide_threshold) |
| 27 : host_impl_(&proxy_, &shared_bitmap_manager_), | 27 : host_impl_(&proxy_, &shared_bitmap_manager_), |
| 28 redraw_needed_(false), | 28 redraw_needed_(false), |
| 29 update_draw_properties_needed_(false), | 29 update_draw_properties_needed_(false), |
| 30 top_controls_top_offset_(0.f), | 30 top_controls_top_offset_(0.f), |
| 31 top_controls_height_(top_controls_height), | 31 top_controls_height_(top_controls_height), |
| 32 top_controls_show_threshold_(top_controls_show_threshold), | 32 top_controls_show_threshold_(top_controls_show_threshold), |
| 33 top_controls_hide_threshold_(top_controls_hide_threshold) { | 33 top_controls_hide_threshold_(top_controls_hide_threshold) { |
| 34 active_tree_ = | 34 active_tree_ = |
| 35 LayerTreeImpl::create(&host_impl_, new SyncedProperty<ScaleGroup>); | 35 LayerTreeImpl::create(&host_impl_, new SyncedProperty<ScaleGroup>, |
| 36 new SyncedElasticOverscroll); |
| 36 root_scroll_layer_ = LayerImpl::Create(active_tree_.get(), 1); | 37 root_scroll_layer_ = LayerImpl::Create(active_tree_.get(), 1); |
| 37 } | 38 } |
| 38 | 39 |
| 39 ~MockTopControlsManagerClient() override {} | 40 ~MockTopControlsManagerClient() override {} |
| 40 | 41 |
| 41 void DidChangeTopControlsPosition() override { | 42 void DidChangeTopControlsPosition() override { |
| 42 redraw_needed_ = true; | 43 redraw_needed_ = true; |
| 43 update_draw_properties_needed_ = true; | 44 update_draw_properties_needed_ = true; |
| 44 } | 45 } |
| 45 | 46 |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 time = base::TimeDelta::FromMicroseconds(100) + time; | 451 time = base::TimeDelta::FromMicroseconds(100) + time; |
| 451 manager->Animate(time); | 452 manager->Animate(time); |
| 452 EXPECT_GT(manager->ControlsTopOffset(), previous_offset); | 453 EXPECT_GT(manager->ControlsTopOffset(), previous_offset); |
| 453 previous_offset = manager->ControlsTopOffset(); | 454 previous_offset = manager->ControlsTopOffset(); |
| 454 } | 455 } |
| 455 EXPECT_FALSE(manager->animation()); | 456 EXPECT_FALSE(manager->animation()); |
| 456 EXPECT_EQ(0.f, manager->ControlsTopOffset()); | 457 EXPECT_EQ(0.f, manager->ControlsTopOffset()); |
| 457 } | 458 } |
| 458 } // namespace | 459 } // namespace |
| 459 } // namespace cc | 460 } // namespace cc |
| OLD | NEW |