Index: content/renderer/render_thread_impl.cc |
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc |
index 31575157bc08ba1173709418b40c4d29471526b8..e5e84b9ca2d64dc23478303e2e845ff3a9c7fe72 100644 |
--- a/content/renderer/render_thread_impl.cc |
+++ b/content/renderer/render_thread_impl.cc |
@@ -173,25 +173,29 @@ const int kMaxRasterThreads = 64; |
// Keep the global RenderThreadImpl in a TLS slot so it is impossible to access |
// incorrectly from the wrong thread. |
-base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> > |
- lazy_tls = LAZY_INSTANCE_INITIALIZER; |
+base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> > lazy_tls = |
+ LAZY_INSTANCE_INITIALIZER; |
class RenderViewZoomer : public RenderViewVisitor { |
public: |
RenderViewZoomer(const std::string& scheme, |
const std::string& host, |
- double zoom_level) : scheme_(scheme), |
- host_(host), |
- zoom_level_(zoom_level) { |
- } |
+ double zoom_level, |
+ const std::set<int>& exceptions) |
+ : scheme_(scheme), |
+ host_(host), |
+ zoom_level_(zoom_level), |
+ exceptions_(exceptions) {} |
virtual bool Visit(RenderView* render_view) OVERRIDE { |
WebView* webview = render_view->GetWebView(); |
WebDocument document = webview->mainFrame()->document(); |
// Don't set zoom level for full-page plugin since they don't use the same |
- // zoom settings. |
- if (document.isPluginDocument()) |
+ // zoom settings. RenderViews associated with tabs in special zoom |
+ // modes (listed in |exceptions_|) should also not be zoomed. |
+ if (document.isPluginDocument() || |
+ exceptions_.count(render_view->GetRoutingID())) |
return true; |
GURL url(document.url()); |
// Empty scheme works as wildcard that matches any scheme, |
@@ -206,6 +210,7 @@ class RenderViewZoomer : public RenderViewVisitor { |
const std::string scheme_; |
const std::string host_; |
const double zoom_level_; |
+ const std::set<int> exceptions_; |
DISALLOW_COPY_AND_ASSIGN(RenderViewZoomer); |
}; |
@@ -1212,10 +1217,12 @@ void RenderThreadImpl::DoNotNotifyWebKitOfModalLoop() { |
notify_webkit_of_modal_loop_ = false; |
} |
-void RenderThreadImpl::OnSetZoomLevelForCurrentURL(const std::string& scheme, |
- const std::string& host, |
- double zoom_level) { |
- RenderViewZoomer zoomer(scheme, host, zoom_level); |
+void RenderThreadImpl::OnSetZoomLevelForCurrentURL( |
+ const std::string& scheme, |
+ const std::string& host, |
+ double zoom_level, |
+ const std::set<int>& exceptions) { |
+ RenderViewZoomer zoomer(scheme, host, zoom_level, exceptions); |
RenderView::ForEach(&zoomer); |
} |