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

Unified Diff: chrome/browser/ui/views/frame/contents_container.h

Issue 22265009: Implement initial version of scroll end effect Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responded to outstanding comments from sadrul@ Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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..72779ee7af750671ea342f4e788b5962037e3193 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,34 @@ class ContentsContainer : public views::View {
// if the margin changed and this view needs Layout().
bool SetActiveTopMargin(int margin);
+ // Fast-resize is used for |active_web_view_| while the scroll-end effect is
+ // active. It also prevents the bounds of the contents from being updated by
+ // layouts of this class.
+ virtual void ActivateScrollEndEffect();
+ virtual void DeactivateScrollEndEffect();
+
+ virtual void UpdateScrollEndEffectHeightDelta(int height_delta,
+ 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);
};
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout_unittest.cc ('k') | chrome/browser/ui/views/frame/contents_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698