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 19 matching lines...) Expand all Loading... |
30 update_draw_properties_needed_(false), | 30 update_draw_properties_needed_(false), |
31 top_controls_top_offset_(0.f), | 31 top_controls_top_offset_(0.f), |
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_ = LayerTreeImpl::create(&host_impl_); | 34 active_tree_ = LayerTreeImpl::create(&host_impl_); |
35 root_scroll_layer_ = LayerImpl::Create(active_tree_.get(), 1); | 35 root_scroll_layer_ = LayerImpl::Create(active_tree_.get(), 1); |
36 } | 36 } |
37 | 37 |
38 virtual ~MockTopControlsManagerClient() {} | 38 virtual ~MockTopControlsManagerClient() {} |
39 | 39 |
40 virtual void DidChangeTopControlsPosition() OVERRIDE { | 40 virtual void DidChangeTopControlsPosition() override { |
41 redraw_needed_ = true; | 41 redraw_needed_ = true; |
42 update_draw_properties_needed_ = true; | 42 update_draw_properties_needed_ = true; |
43 } | 43 } |
44 | 44 |
45 virtual bool HaveRootScrollLayer() const OVERRIDE { | 45 virtual bool HaveRootScrollLayer() const override { |
46 return true; | 46 return true; |
47 } | 47 } |
48 | 48 |
49 virtual void SetControlsTopOffset(float offset) OVERRIDE { | 49 virtual void SetControlsTopOffset(float offset) override { |
50 top_controls_top_offset_ = offset; | 50 top_controls_top_offset_ = offset; |
51 } | 51 } |
52 | 52 |
53 virtual float ControlsTopOffset() const OVERRIDE { | 53 virtual float ControlsTopOffset() const override { |
54 return top_controls_top_offset_; | 54 return top_controls_top_offset_; |
55 } | 55 } |
56 | 56 |
57 LayerImpl* rootScrollLayer() { | 57 LayerImpl* rootScrollLayer() { |
58 return root_scroll_layer_.get(); | 58 return root_scroll_layer_.get(); |
59 } | 59 } |
60 | 60 |
61 TopControlsManager* manager() { | 61 TopControlsManager* manager() { |
62 if (!manager_) { | 62 if (!manager_) { |
63 manager_ = TopControlsManager::Create(this, | 63 manager_ = TopControlsManager::Create(this, |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 manager->Animate(time); | 377 manager->Animate(time); |
378 EXPECT_GT(manager->ControlsTopOffset(), previous_offset); | 378 EXPECT_GT(manager->ControlsTopOffset(), previous_offset); |
379 previous_offset = manager->ControlsTopOffset(); | 379 previous_offset = manager->ControlsTopOffset(); |
380 } | 380 } |
381 EXPECT_FALSE(manager->animation()); | 381 EXPECT_FALSE(manager->animation()); |
382 EXPECT_EQ(0.f, manager->ControlsTopOffset()); | 382 EXPECT_EQ(0.f, manager->ControlsTopOffset()); |
383 } | 383 } |
384 | 384 |
385 } // namespace | 385 } // namespace |
386 } // namespace cc | 386 } // namespace cc |
OLD | NEW |