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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2936423003: Move Get/SetScrollOffset methods from WebFrame to WebLocalFrame. (Closed)
Patch Set: Use WebViewHelper::LocalMainFrame() where possible. Created 3 years, 6 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/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 21a5ee3b10c045194ab2653257dbe8d8cbea49bc..ec04967ad0ed32e6615cb54abe6f0cdeaf0ea4b7 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -1294,8 +1294,13 @@ WebRect WebViewImpl::WidenRectWithinPageBounds(const WebRect& source,
if (MainFrame())
max_size = MainFrame()->ContentsSize();
IntSize scroll_offset;
- if (MainFrame())
- scroll_offset = MainFrame()->GetScrollOffset();
+ if (MainFrame()) {
+ // TODO(lukasza): https://crbug.com/734209: The DCHECK below holds now, but
+ // only because all of the callers don't support OOPIFs and exit early if
+ // the main frame is not local.
+ DCHECK(MainFrame()->IsWebLocalFrame());
+ scroll_offset = MainFrame()->ToWebLocalFrame()->GetScrollOffset();
+ }
int left_margin = target_margin;
int right_margin = target_margin;
@@ -1515,6 +1520,7 @@ void WebViewImpl::EnableTapHighlights(
}
void WebViewImpl::AnimateDoubleTapZoom(const IntPoint& point_in_root_frame) {
+ // TODO(lukasza): https://crbug.com/734209: Add OOPIF support.
if (!MainFrameImpl())
return;
@@ -1561,6 +1567,7 @@ void WebViewImpl::AnimateDoubleTapZoom(const IntPoint& point_in_root_frame) {
}
void WebViewImpl::ZoomToFindInPageRect(const WebRect& rect_in_root_frame) {
+ // TODO(lukasza): https://crbug.com/734209: Add OOPIF support.
if (!MainFrameImpl())
return;
@@ -1587,6 +1594,7 @@ void WebViewImpl::ZoomToFindInPageRect(const WebRect& rect_in_root_frame) {
}
bool WebViewImpl::ZoomToMultipleTargetsRect(const WebRect& rect_in_root_frame) {
+ // TODO(lukasza): https://crbug.com/734209: Add OOPIF support.
if (!MainFrameImpl())
return false;

Powered by Google App Engine
This is Rietveld 408576698