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

Unified Diff: third_party/WebKit/Source/core/frame/VisualViewport.h

Issue 1814013002: Visual viewport API initial implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 9 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: third_party/WebKit/Source/core/frame/VisualViewport.h
diff --git a/third_party/WebKit/Source/core/frame/VisualViewport.h b/third_party/WebKit/Source/core/frame/VisualViewport.h
index a7d6be9003d412f9b7c4faa4c56cff2ad7582c79..a34e4c04b5254cac7854615293f3a17a37bb364f 100644
--- a/third_party/WebKit/Source/core/frame/VisualViewport.h
+++ b/third_party/WebKit/Source/core/frame/VisualViewport.h
@@ -32,6 +32,7 @@
#define VisualViewport_h
#include "core/CoreExport.h"
+#include "core/events/Event.h"
#include "platform/geometry/FloatPoint.h"
#include "platform/geometry/FloatRect.h"
#include "platform/geometry/IntSize.h"
@@ -61,8 +62,13 @@ class LocalFrame;
// offset is set through the GraphicsLayer <-> CC sync mechanisms. Its contents is the page's
// main FrameView, which corresponds to the outer viewport. The inner viewport is always contained
// in the outer viewport and can pan within it.
-class CORE_EXPORT VisualViewport final : public NoBaseWillBeGarbageCollectedFinalized<VisualViewport>, public GraphicsLayerClient, public ScrollableArea {
+class CORE_EXPORT VisualViewport final
+ : public NoBaseWillBeGarbageCollectedFinalized<VisualViewport>
+ , public GraphicsLayerClient
+ , public ScriptWrappable
+ , public ScrollableArea {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(VisualViewport);
+ DEFINE_WRAPPERTYPEINFO();
public:
static PassOwnPtrWillBeRawPtr<VisualViewport> create(FrameHost& host)
{
@@ -196,6 +202,17 @@ public:
Widget* getWidget() override;
CompositorAnimationTimeline* compositorAnimationTimeline() const override;
+ void updateLayoutIgnorePendingStylesheets();
esprehn 2016/03/24 19:20:17 I'd rather you didn't proxy this method. Callers s
ymalik 2016/03/29 19:17:28 You mentioned below that this method should be pri
+
+ // Visual Viewport API implementation.
+ double scrollLeft();
+ double scrollTop();
+ void setScrollLeft(double x);
+ void setScrollTop(double y);
+ double clientWidth();
+ double clientHeight();
+ double pageScale();
+
// Used for gathering data on user pinch-zoom statistics.
void userDidChangeScale();
void sendUMAMetrics();
@@ -210,6 +227,8 @@ private:
bool visualViewportSuppliesScrollbars() const;
+ void dispatchChangedEvent();
+
// GraphicsLayerClient implementation.
IntRect computeInterestRect(const GraphicsLayer*, const IntRect&) const;
void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect&) const override;

Powered by Google App Engine
This is Rietveld 408576698