Index: chrome/browser/ui/views/frame/contents_container.h |
diff --git a/chrome/browser/ui/views/frame/contents_container.h b/chrome/browser/ui/views/frame/contents_container.h |
index cfd6d9a2e16d0d2eff3ab310045e7815bc269174..f7e1742e1056f58e42c98a87494895575bdee143 100644 |
--- a/chrome/browser/ui/views/frame/contents_container.h |
+++ b/chrome/browser/ui/views/frame/contents_container.h |
@@ -9,13 +9,20 @@ |
#include "base/basictypes.h" |
#include "base/compiler_specific.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "ui/compositor/layer.h" |
+#include "ui/gfx/rect.h" |
#include "ui/views/view.h" |
+namespace views { |
+class WebView; |
+} |
+ |
// ContentsContainer is responsible for managing the active WebContents view. |
// ContentsContainer has one child: the currently active WebContents. |
class ContentsContainer : public views::View { |
public: |
- explicit ContentsContainer(views::View* active_web_view); |
+ explicit ContentsContainer(views::WebView* active_web_view); |
virtual ~ContentsContainer(); |
// Sets the active top margin; the active WebView's y origin would be |
@@ -24,17 +31,37 @@ class ContentsContainer : public views::View { |
// if the margin changed and this view needs Layout(). |
bool SetActiveTopMargin(int margin); |
+ // When the scroll end effect is active the clipping layer is inserted into |
+ // the layer hierarchy above the web contents and used to prevent it from |
+ // occluding other elements of the browser. It also prevents the bounds of the |
+ // contents from being updated by layouts of this class. |
sadrul
2013/10/25 18:28:25
Don't mention the clipping layer here. Make a note
rharrison
2013/11/18 21:52:26
Done.
|
+ virtual void ActivateScrollEndEffect(); |
+ virtual void DeactivateScrollEndEffect(); |
+ |
+ // Adjusts the location of the contents and the clipping layer relative to |
+ // each other in response to an update from the effect controller. |
+ virtual void UpdateScrollEndEffectHeightDelta(int height_delta, |
sadrul
2013/10/25 18:28:25
Don't really need the comment here. (the clipping
rharrison
2013/11/18 21:52:26
Done.
|
+ bool scrolling_down); |
+ |
// Overridden from views::View: |
virtual void Layout() OVERRIDE; |
virtual const char* GetClassName() const OVERRIDE; |
private: |
- views::View* active_web_view_; |
+ views::WebView* active_web_view_; |
// The margin between the top and the active view. This is used to make the |
// find bar overlap the detached bookmark bar on the new tab page. |
int active_top_margin_; |
+ // When the effect is active the web contents will not have its bounds |
+ // adjusted on layout and instead will just be clipped. |
+ bool scroll_effect_active_; |
+ |
+ // Stores the bounds of the web_view before the scroll end effect starts. This |
+ // allows for restoring the bounds of the view at the end of the effect. |
+ gfx::Rect web_view_bounds_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ContentsContainer); |
}; |