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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 11866004: Add scheme to HostZoomMap (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add namespace Created 7 years, 9 months 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 | « content/renderer/render_thread_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 2fbd67740341091b32002401cde27c138ce83d2d..08e3674491e464c7a57c4b487beb7ac79e2b347a 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -143,8 +143,11 @@ 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,
+ double zoom_level) : scheme_(scheme),
+ host_(host),
+ zoom_level_(zoom_level) {
}
virtual bool Visit(RenderView* render_view) OVERRIDE {
@@ -155,15 +158,19 @@ class RenderViewZoomer : public RenderViewVisitor {
// zoom settings.
if (document.isPluginDocument())
return true;
-
- if (net::GetHostOrSpecFromURL(GURL(document.url())) == host_)
+ GURL url(document.url());
+ // Empty scheme works as wildcard that matches any scheme,
+ if ((net::GetHostOrSpecFromURL(url) == host_) &&
+ (scheme_.empty() || scheme_ == url.scheme())) {
webview->setZoomLevel(false, zoom_level_);
+ }
return true;
}
private:
- std::string host_;
- double zoom_level_;
+ const std::string scheme_;
+ const std::string host_;
+ const double zoom_level_;
DISALLOW_COPY_AND_ASSIGN(RenderViewZoomer);
};
@@ -1080,9 +1087,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);
}
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698