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

Unified Diff: Source/web/WebViewImpl.h

Issue 893683003: Implement top controls show/hide functionality for main thread scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix hiding at the page bottom issue Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: Source/web/WebViewImpl.h
diff --git a/Source/web/WebViewImpl.h b/Source/web/WebViewImpl.h
index 70896b71787c276cb6bcbd6633204d8511a97c80..ebdc6ea54b2c2885862d788cdb1972d9cfc8b73b 100644
--- a/Source/web/WebViewImpl.h
+++ b/Source/web/WebViewImpl.h
@@ -60,6 +60,7 @@
#include "web/PageWidgetDelegate.h"
#include "web/SpellCheckerClientImpl.h"
#include "web/StorageClientImpl.h"
+#include "web/TopControls.h"
#include "wtf/OwnPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/Vector.h"
@@ -517,15 +518,21 @@ public:
bool matchesHeuristicsForGpuRasterizationForTesting() const { return m_matchesHeuristicsForGpuRasterization; }
virtual void setTopControlsHeight(float height, bool topControlsShrinkLayoutSize) override;
+ virtual void updateTopControlsState(WebTopControlsState constraint, WebTopControlsState current, bool animate) override;
+
+ // Exposed for tests.
+ TopControls* topControls() { return m_topControls.get(); }
+ // Called anytime top controls layout height or content offset have changed.
+ void didUpdateTopControls();
+ // Called by top controls manager to determine if top controls should scroll.
+ bool shouldTopControlsConsumeScroll(float scrollDeltaY);
virtual void forceNextWebGLContextCreationToFail() override;
IntSize mainFrameSize();
private:
- void didUpdateTopControls();
void setTopControlsShownRatio(float);
-
// TODO(bokan): Remains for legacy pinch. Remove once it's gone. Made private to
// prevent external usage
virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) override;
@@ -757,14 +764,7 @@ private:
bool m_userGestureObserved;
- // The top controls shown amount (normalized from 0 to 1) since the last
- // compositor commit.
- float m_topControlsShownRatio;
-
- float m_topControlsHeight;
- // If this is true, then the embedder shrunk the WebView size by the top
- // controls height.
- bool m_topControlsShrinkLayoutSize;
+ OwnPtr<TopControls> m_topControls;
aelias_OOO_until_Jul13 2015/02/13 02:03:17 The lifetime is identical to WebViewImpl, so let's
majidvp 2015/02/18 21:03:57 Done. Moved it inside FrameHost and made it a regu
};
DEFINE_TYPE_CASTS(WebViewImpl, WebWidget, widget, widget->isWebView(), widget.isWebView());

Powered by Google App Engine
This is Rietveld 408576698