Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_SCROLL_END_EFFECT_CONTROLLER_ASH_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_SCROLL_END_EFFECT_CONTROLLER_ASH_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_SCROLL_END_EFFECT_CONTROLLER_ASH_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_SCROLL_END_EFFECT_CONTROLLER_ASH_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 9 #include "chrome/browser/ui/views/frame/scroll_end_effect_controller.h" | 10 #include "chrome/browser/ui/views/frame/scroll_end_effect_controller.h" |
| 11 #include "ui/compositor/layer.h" | |
| 12 #include "ui/gfx/rect.h" | |
| 13 | |
| 14 namespace views { | |
| 15 class View; | |
| 16 } | |
| 10 | 17 |
| 11 class ScrollEndEffectControllerAsh : public ScrollEndEffectController { | 18 class ScrollEndEffectControllerAsh : public ScrollEndEffectController { |
| 12 public: | 19 public: |
| 13 ScrollEndEffectControllerAsh(); | 20 explicit ScrollEndEffectControllerAsh(BrowserView* view); |
| 14 virtual ~ScrollEndEffectControllerAsh(); | 21 virtual ~ScrollEndEffectControllerAsh(); |
| 15 | 22 |
| 16 // ScrollEndEffectController overides: | 23 // ScrollEndEffectController overides: |
| 17 virtual void OverscrollUpdate(int delta_y) OVERRIDE; | 24 virtual void OverscrollUpdate(int delta_y) OVERRIDE; |
| 18 | 25 |
| 19 private: | 26 private: |
| 27 // Sets up the layer topology for showing the effect. This involves making | |
|
sky
2013/08/21 21:01:01
I don't think we've ever used topology for what th
rharrison
2013/08/22 15:08:39
Done.
| |
| 28 // sure everything is on a layer and inserting clipping layers into the | |
| 29 // topology. | |
| 30 void ActivateEffect(); | |
| 31 | |
| 32 // Restores the layer topology and states to what they were before the effect | |
| 33 // was actived. | |
| 34 void DeactivateEffect(); | |
| 35 | |
| 36 void ApplyDelta(ui::Layer* frame, gfx::Rect bounds, int delta_y); | |
|
sky
2013/08/21 21:01:01
const gfx::Rect& and add a description.
rharrison
2013/08/22 15:08:39
Done.
| |
| 37 | |
| 38 BrowserView* browser_view_; // non-owned | |
| 39 bool is_effect_active_; | |
| 40 | |
| 41 scoped_ptr<ui::Layer> frame_clipping_layer_; | |
| 42 scoped_ptr<ui::Layer> web_clipping_layer_; | |
| 43 ui::Layer* web_contents_layer_; // non-owned | |
| 44 ui::Layer* non_client_layer_; // non-owned | |
| 45 | |
| 46 // Height of the top of the window that needs to be not be occluded by the | |
| 47 // |web_clipping_layer_| so that things like the controls show through.| | |
|
sky
2013/08/21 21:01:01
nuke trailing |
rharrison
2013/08/22 15:08:39
Done.
| |
| 48 int non_content_height_; | |
| 49 | |
| 50 // Used to reparent |web_contents_layer_| when deactivating the effect. | |
| 51 ui::Layer* web_contents_parent_; // non-owned | |
| 52 | |
| 53 // Saved when the effective is activated, so it can be restored when the | |
|
sky
2013/08/21 21:01:01
effective?
rharrison
2013/08/22 15:08:39
Done.
| |
| 54 // effect is deactivated. | |
| 55 gfx::Rect web_contents_bounds_; | |
| 56 | |
| 57 // Used to turn off being on a layer when deactivating the effect. | |
| 58 views::View* non_client_view_; // non-owned | |
| 59 | |
| 60 | |
| 20 DISALLOW_COPY_AND_ASSIGN(ScrollEndEffectControllerAsh); | 61 DISALLOW_COPY_AND_ASSIGN(ScrollEndEffectControllerAsh); |
| 21 }; | 62 }; |
| 22 | 63 |
| 23 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_SCROLL_END_EFFECT_CONTROLLER_ASH_H_ | 64 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_SCROLL_END_EFFECT_CONTROLLER_ASH_H_ |
| OLD | NEW |