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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2936423003: Move Get/SetScrollOffset methods from WebFrame to WebLocalFrame. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 return WebRect(); 1289 return WebRect();
1290 } 1290 }
1291 1291
1292 WebRect WebViewImpl::WidenRectWithinPageBounds(const WebRect& source, 1292 WebRect WebViewImpl::WidenRectWithinPageBounds(const WebRect& source,
1293 int target_margin, 1293 int target_margin,
1294 int minimum_margin) { 1294 int minimum_margin) {
1295 WebSize max_size; 1295 WebSize max_size;
1296 if (MainFrame()) 1296 if (MainFrame())
1297 max_size = MainFrame()->ContentsSize(); 1297 max_size = MainFrame()->ContentsSize();
1298 IntSize scroll_offset; 1298 IntSize scroll_offset;
1299 if (MainFrame()) 1299 if (MainFrame() && MainFrame()->IsWebLocalFrame())
1300 scroll_offset = MainFrame()->GetScrollOffset(); 1300 scroll_offset = MainFrame()->ToWebLocalFrame()->GetScrollOffset();
dcheng 2017/06/16 00:03:41 Ditto.
Łukasz Anforowicz 2017/06/16 21:28:13 Done.
1301 int left_margin = target_margin; 1301 int left_margin = target_margin;
1302 int right_margin = target_margin; 1302 int right_margin = target_margin;
1303 1303
1304 const int absolute_source_x = source.x + scroll_offset.Width(); 1304 const int absolute_source_x = source.x + scroll_offset.Width();
1305 if (left_margin > absolute_source_x) { 1305 if (left_margin > absolute_source_x) {
1306 left_margin = absolute_source_x; 1306 left_margin = absolute_source_x;
1307 right_margin = std::max(left_margin, minimum_margin); 1307 right_margin = std::max(left_margin, minimum_margin);
1308 } 1308 }
1309 1309
1310 const int maximum_right_margin = 1310 const int maximum_right_margin =
(...skipping 2809 matching lines...) Expand 10 before | Expand all | Expand 10 after
4120 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) 4120 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame())
4121 return nullptr; 4121 return nullptr;
4122 return focused_frame; 4122 return focused_frame;
4123 } 4123 }
4124 4124
4125 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { 4125 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const {
4126 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; 4126 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr;
4127 } 4127 }
4128 4128
4129 } // namespace blink 4129 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698