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.h" | 8 #include "base/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 16 matching lines...) Expand all Loading... |
27 redraw_needed_(false), | 27 redraw_needed_(false), |
28 update_draw_properties_needed_(false), | 28 update_draw_properties_needed_(false), |
29 top_controls_show_threshold_(top_controls_show_threshold), | 29 top_controls_show_threshold_(top_controls_show_threshold), |
30 top_controls_hide_threshold_(top_controls_hide_threshold) { | 30 top_controls_hide_threshold_(top_controls_hide_threshold) { |
31 active_tree_ = LayerTreeImpl::create(&host_impl_); | 31 active_tree_ = LayerTreeImpl::create(&host_impl_); |
32 root_scroll_layer_ = LayerImpl::Create(active_tree_.get(), 1); | 32 root_scroll_layer_ = LayerImpl::Create(active_tree_.get(), 1); |
33 } | 33 } |
34 | 34 |
35 virtual ~MockTopControlsManagerClient() {} | 35 virtual ~MockTopControlsManagerClient() {} |
36 | 36 |
37 virtual void setNeedsRedraw() OVERRIDE { | 37 virtual void DidChangeTopControlsPosition() OVERRIDE { |
38 redraw_needed_ = true; | 38 redraw_needed_ = true; |
39 } | |
40 | |
41 virtual void setActiveTreeNeedsUpdateDrawProperties() OVERRIDE { | |
42 update_draw_properties_needed_ = true; | 39 update_draw_properties_needed_ = true; |
43 } | 40 } |
44 | 41 |
45 virtual bool haveRootScrollLayer() const OVERRIDE { | 42 virtual bool HaveRootScrollLayer() const OVERRIDE { |
46 return true; | 43 return true; |
47 } | 44 } |
48 | 45 |
49 LayerImpl* rootScrollLayer() { | 46 LayerImpl* rootScrollLayer() { |
50 return root_scroll_layer_.get(); | 47 return root_scroll_layer_.get(); |
51 } | 48 } |
52 | 49 |
53 TopControlsManager* manager() { | 50 TopControlsManager* manager() { |
54 if (!manager_) { | 51 if (!manager_) { |
55 manager_ = TopControlsManager::Create(this, | 52 manager_ = TopControlsManager::Create(this, |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 EXPECT_GT(manager->controls_top_offset(), previous_offset); | 281 EXPECT_GT(manager->controls_top_offset(), previous_offset); |
285 previous_offset = manager->controls_top_offset(); | 282 previous_offset = manager->controls_top_offset(); |
286 } | 283 } |
287 EXPECT_FALSE(manager->animation()); | 284 EXPECT_FALSE(manager->animation()); |
288 EXPECT_EQ(0.f, manager->controls_top_offset()); | 285 EXPECT_EQ(0.f, manager->controls_top_offset()); |
289 EXPECT_EQ(100.f, manager->content_top_offset()); | 286 EXPECT_EQ(100.f, manager->content_top_offset()); |
290 } | 287 } |
291 | 288 |
292 } // namespace | 289 } // namespace |
293 } // namespace cc | 290 } // namespace cc |
OLD | NEW |