Index: content/renderer/render_thread_impl.cc |
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc |
index 7dd13c2389f7b8d98f4d82540b14b5cfda91b21b..e44a76f6d60d0b88ee8640b25e18df3b8cd6d7ba 100644 |
--- a/content/renderer/render_thread_impl.cc |
+++ b/content/renderer/render_thread_impl.cc |
@@ -141,8 +141,10 @@ base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> > |
class RenderViewZoomer : public RenderViewVisitor { |
public: |
- RenderViewZoomer(const std::string& host, double zoom_level) |
- : host_(host), zoom_level_(zoom_level) { |
+ RenderViewZoomer(const std::string& scheme, |
+ const std::string& host, |
sky
2013/02/11 17:13:26
align with '(' on previous line (same comment for
Denis Kuznetsov (DE-MUC)
2013/02/12 13:10:45
Done.
|
+ double zoom_level) |
+ : scheme_(scheme), host_(host), zoom_level_(zoom_level) { |
sky
2013/02/11 17:13:26
since the constructor doesn't fit on one line each
Denis Kuznetsov (DE-MUC)
2013/02/12 13:10:45
Done.
|
} |
virtual bool Visit(RenderView* render_view) { |
@@ -153,13 +155,16 @@ class RenderViewZoomer : public RenderViewVisitor { |
// zoom settings. |
if (document.isPluginDocument()) |
return true; |
- |
- if (net::GetHostOrSpecFromURL(GURL(document.url())) == host_) |
+ GURL url(document.url()); |
+ if ((net::GetHostOrSpecFromURL(url) == host_) && |
+ (scheme_.empty() || scheme_ == url.scheme())) { |
sky
2013/02/11 17:13:26
Why the empty() check?
Denis Kuznetsov (DE-MUC)
2013/02/12 13:10:45
We use same message for SetForHost and SetForHostA
|
webview->setZoomLevel(false, zoom_level_); |
+ } |
return true; |
} |
private: |
+ std::string scheme_; |
sky
2013/02/11 17:13:26
const on these.
Denis Kuznetsov (DE-MUC)
2013/02/12 13:10:45
Done.
|
std::string host_; |
double zoom_level_; |
@@ -1024,9 +1029,10 @@ void RenderThreadImpl::DoNotNotifyWebKitOfModalLoop() { |
notify_webkit_of_modal_loop_ = false; |
} |
-void RenderThreadImpl::OnSetZoomLevelForCurrentURL(const std::string& host, |
+void RenderThreadImpl::OnSetZoomLevelForCurrentURL(const std::string& scheme, |
+ const std::string& host, |
double zoom_level) { |
- RenderViewZoomer zoomer(host, zoom_level); |
+ RenderViewZoomer zoomer(scheme, host, zoom_level); |
RenderView::ForEach(&zoomer); |
} |