diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 07:17:54 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 07:17:54 +0000 |
commit | 9d797f394f319b754ed91a981dab566d764d2c2e (patch) | |
tree | aee695b1c2af9d540e3fe99d834de015f70665cf /chrome/renderer/render_thread.cc | |
parent | 97c9e77b34099c518f85571f6d36e178d7695b23 (diff) | |
download | chromium_src-9d797f394f319b754ed91a981dab566d764d2c2e.zip chromium_src-9d797f394f319b754ed91a981dab566d764d2c2e.tar.gz chromium_src-9d797f394f319b754ed91a981dab566d764d2c2e.tar.bz2 |
Send content settings based on the URL to the renderer instead of just the host.
BUG=36025
TEST=manual
Review URL: http://codereview.chromium.org/1744003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45424 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_thread.cc')
-rw-r--r-- | chrome/renderer/render_thread.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index b7fb2af..ce746e4 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -61,6 +61,7 @@ #include "chrome/renderer/user_script_slave.h" #include "ipc/ipc_message.h" #include "ipc/ipc_platform_file.h" +#include "net/base/net_util.h" #include "third_party/tcmalloc/chromium/src/google/malloc_extension.h" #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" #include "third_party/WebKit/WebKit/chromium/public/WebColor.h" @@ -171,14 +172,14 @@ class RenderViewContentSettingsSetter : public RenderViewVisitor { class RenderViewZoomer : public RenderViewVisitor { public: - RenderViewZoomer(const std::string& host, int zoom_level) - : host_(host), - zoom_level_(zoom_level) { + RenderViewZoomer(const GURL& url, int zoom_level) + : zoom_level_(zoom_level) { + host_ = net::GetHostOrSpecFromURL(url); } virtual bool Visit(RenderView* render_view) { WebView* webview = render_view->webview(); // Guaranteed non-NULL. - if (GURL(webview->mainFrame()->url()).host() == host_) + if (net::GetHostOrSpecFromURL(GURL(webview->mainFrame()->url())) == host_) webview->setZoomLevel(false, zoom_level_); return true; } @@ -457,9 +458,9 @@ void RenderThread::OnSetContentSettingsForCurrentURL( RenderView::ForEach(&setter); } -void RenderThread::OnSetZoomLevelForCurrentHost(const std::string& host, - int zoom_level) { - RenderViewZoomer zoomer(host, zoom_level); +void RenderThread::OnSetZoomLevelForCurrentURL(const GURL& url, + int zoom_level) { + RenderViewZoomer zoomer(url, zoom_level); RenderView::ForEach(&zoomer); } @@ -531,8 +532,8 @@ void RenderThread::OnControlMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_Reset, OnResetVisitedLinks) IPC_MESSAGE_HANDLER(ViewMsg_SetContentSettingsForCurrentURL, OnSetContentSettingsForCurrentURL) - IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForCurrentHost, - OnSetZoomLevelForCurrentHost) + IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForCurrentURL, + OnSetZoomLevelForCurrentURL) IPC_MESSAGE_HANDLER(ViewMsg_SetIsIncognitoProcess, OnSetIsIncognitoProcess) IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID) IPC_MESSAGE_HANDLER(ViewMsg_SetCSSColors, OnSetCSSColors) |