summaryrefslogtreecommitdiffstats
path: root/webkit/glue/plugins
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-10 18:16:24 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-10 18:16:24 +0000
commit445f5b62410598d51e1d7f64c1f6cf7890dfe1d8 (patch)
treeb94290b2a5d3c7830095d66b3ffb2e9fc1c5e2d6 /webkit/glue/plugins
parent807aa93835fa0ada2ccbe849fbc1bb4b5cf7fb46 (diff)
downloadchromium_src-445f5b62410598d51e1d7f64c1f6cf7890dfe1d8.zip
chromium_src-445f5b62410598d51e1d7f64c1f6cf7890dfe1d8.tar.gz
chromium_src-445f5b62410598d51e1d7f64c1f6cf7890dfe1d8.tar.bz2
Fix a plugin taking a whole iframe from messing with the page's zoom level.
BUG=65395 Review URL: http://codereview.chromium.org/5774001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68868 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins')
-rw-r--r--webkit/glue/plugins/pepper_plugin_instance.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/webkit/glue/plugins/pepper_plugin_instance.cc b/webkit/glue/plugins/pepper_plugin_instance.cc
index b4cd681..f705178 100644
--- a/webkit/glue/plugins/pepper_plugin_instance.cc
+++ b/webkit/glue/plugins/pepper_plugin_instance.cc
@@ -244,6 +244,13 @@ void ZoomChanged(PP_Instance instance_id, double factor) {
PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id);
if (!instance)
return;
+
+ // We only want to tell the page to change its zoom if the whole page is the
+ // PDF. If we're in an iframe, then don't do anything.
+ WebFrame* frame = instance->container()->element().document().frame();
+ if (!frame->view()->mainFrame()->document().isPluginDocument())
+ return;
+
double zoom_level = WebView::zoomFactorToZoomLevel(factor);
// The conversino from zoom level to factor, and back, can introduce rounding
// errors. i.e. WebKit originally tells us 3.0, but by the time we tell the