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

Unified Diff: webkit/glue/plugins/pepper_plugin_instance.cc

Issue 5774001: Fix a plugin taking a whole iframe from messing with the page's zoom level.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/pepper_plugin_instance.cc
===================================================================
--- webkit/glue/plugins/pepper_plugin_instance.cc (revision 68741)
+++ webkit/glue/plugins/pepper_plugin_instance.cc (working copy)
@@ -244,6 +244,13 @@
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698