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

Unified Diff: Source/core/frame/FrameView.cpp

Issue 225303014: [Pinch-to-zoom] Moved scale factor into PinchViewport (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed layout test breakage Created 6 years, 8 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
« no previous file with comments | « Source/core/frame/FrameHost.cpp ('k') | Source/core/frame/PinchViewport.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 9d329e47dc387d133df127467e863157ce29000c..c3bd0c4c57209b2d65d70a3f8185d4e0ff5c9905 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -37,6 +37,7 @@
#include "core/events/OverflowEvent.h"
#include "core/fetch/ResourceFetcher.h"
#include "core/fetch/ResourceLoadPriorityOptimizer.h"
+#include "core/frame/FrameHost.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
#include "core/html/HTMLFrameElement.h"
@@ -2359,7 +2360,10 @@ IntSize FrameView::inputEventsOffsetForEmulation() const
float FrameView::inputEventsScaleFactor() const
{
- return visibleContentScaleFactor() * m_inputEventsScaleFactorForEmulation;
+ float pageScale = m_frame->settings()->pinchVirtualViewportEnabled()
+ ? m_frame->page()->frameHost().pinchViewport().scale()
+ : visibleContentScaleFactor();
+ return pageScale * m_inputEventsScaleFactorForEmulation;
}
bool FrameView::scrollbarsCanBeActive() const
@@ -3129,18 +3133,24 @@ void FrameView::removeChild(Widget* widget)
bool FrameView::wheelEvent(const PlatformWheelEvent& wheelEvent)
{
+ bool allowScrolling = userInputScrollable(HorizontalScrollbar) || userInputScrollable(VerticalScrollbar);
+
// Note that to allow for rubber-band over-scroll behavior, even non-scrollable views
// should handle wheel events.
#if !USE(RUBBER_BANDING)
if (!isScrollable())
- return false;
+ allowScrolling = false;
#endif
- // We don't allow mouse wheeling to happen in a ScrollView that has had its scrollbars explicitly disabled.
- if (!canHaveScrollbars())
- return false;
+ if (allowScrolling && ScrollableArea::handleWheelEvent(wheelEvent))
+ return true;
+
+ // If the frame didn't handle the event, give the pinch-zoom viewport a chance to
+ // process the scroll event.
+ if (m_frame->settings()->pinchVirtualViewportEnabled() && m_frame->isMainFrame())
+ return page()->frameHost().pinchViewport().handleWheelEvent(wheelEvent);
- return ScrollableArea::handleWheelEvent(wheelEvent);
+ return false;
}
bool FrameView::isVerticalDocument() const
« no previous file with comments | « Source/core/frame/FrameHost.cpp ('k') | Source/core/frame/PinchViewport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698