diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-06 02:58:48 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-06 02:58:48 +0000 |
commit | e76b7971143c4b7834623d1334de06b8593c5b22 (patch) | |
tree | 78c054f8606b6a1e5c04dd7dd2e2d3d10ea196e0 /content/renderer/render_view_impl.cc | |
parent | 34a7fa82e1c3f64bbf54933a183df84ee4676298 (diff) | |
download | chromium_src-e76b7971143c4b7834623d1334de06b8593c5b22.zip chromium_src-e76b7971143c4b7834623d1334de06b8593c5b22.tar.gz chromium_src-e76b7971143c4b7834623d1334de06b8593c5b22.tar.bz2 |
Use WebView::contentsPreferredMinimumSize instead of deprecated WebFrame calls
This call has the same behavior but is slightly more efficient since it only
checks that layout is up to date once.
BUG=243314
Review URL: https://chromiumcodereview.appspot.com/16386002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204400 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/render_view_impl.cc')
-rw-r--r-- | content/renderer/render_view_impl.cc | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index ca49362..6851b4e 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -4205,14 +4205,7 @@ void RenderViewImpl::CheckPreferredSize() { if (!send_preferred_size_changes_ || !webview()) return; - gfx::Size size(webview()->mainFrame()->contentsPreferredWidth(), - webview()->mainFrame()->documentElementScrollHeight()); - - // In the presence of zoom, these sizes are still reported as if unzoomed, - // so we need to adjust. - double zoom_factor = WebView::zoomLevelToZoomFactor(webview()->zoomLevel()); - size.set_width(static_cast<int>(size.width() * zoom_factor)); - size.set_height(static_cast<int>(size.height() * zoom_factor)); + gfx::Size size = webview()->contentsPreferredMinimumSize(); if (size == preferred_size_) return; |