Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(907)

Side by Side Diff: chrome/browser/ui/views/frame/scroll_end_effect_controller_ash.h

Issue 22265009: Implement initial version of scroll end effect Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Set up the layer topology for showing the effect. This involves making sure
sadrul 2013/08/20 16:14:59 Sets up
rharrison 2013/08/20 19:57:41 Done.
28 // everything is on a layer and inserting clipping layers into the topology.
29 void ActivateEffect();
30
31 // Restore the layer topology and states to what they were before the effect
sadrul 2013/08/20 16:14:59 Restores
rharrison 2013/08/20 19:57:41 Done.
32 // was actived.
33 void DeactivateEffect();
34
35 void ApplyDelta(ui::Layer* frame, gfx::Rect bounds, int delta_y);
36
37 BrowserView* browser_view_; // non-owned
38 bool is_effect_active_;
39
40 scoped_ptr<ui::Layer> frame_clipping_layer_;
41 scoped_ptr<ui::Layer> web_clipping_layer_;
42 ui::Layer* browser_frame_layer_; // non-owned
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.|
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698