diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-23 23:57:33 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-23 23:57:33 +0000 |
commit | abbfaec6e99118ad6994d563606631967bd9e567 (patch) | |
tree | c2c81199c609a4c3d9d4a06951c651150f329401 /content | |
parent | 89805c18c0ce6ab0e5c68d58688921b7d3340236 (diff) | |
download | chromium_src-abbfaec6e99118ad6994d563606631967bd9e567.zip chromium_src-abbfaec6e99118ad6994d563606631967bd9e567.tar.gz chromium_src-abbfaec6e99118ad6994d563606631967bd9e567.tar.bz2 |
Replace "http" etc with the url_constants version. This was a previous TODO for webplugin_proxy.cc, and I fixed the other places as well.
Review URL: http://codereview.chromium.org/6990043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86368 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/renderer_host/render_view_host.cc | 26 | ||||
-rw-r--r-- | content/browser/tab_contents/tab_contents_observer.cc | 4 | ||||
-rw-r--r-- | content/plugin/webplugin_proxy.cc | 7 | ||||
-rw-r--r-- | content/renderer/render_view.cc | 2 |
4 files changed, 32 insertions, 7 deletions
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc index 2044e66..d0cd465 100644 --- a/content/browser/renderer_host/render_view_host.cc +++ b/content/browser/renderer_host/render_view_host.cc @@ -22,6 +22,7 @@ #include "content/browser/child_process_security_policy.h" #include "content/browser/content_browser_client.h" #include "content/browser/cross_site_request_manager.h" +#include "content/browser/host_zoom_map.h" #include "content/browser/in_process_webkit/session_storage_namespace.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host_delegate.h" @@ -234,7 +235,7 @@ void RenderViewHost::Navigate(const ViewMsg_Navigate_Params& params) { } const GURL& url = params.url; if (!delegate_->IsExternalTabContainer() && - (url.SchemeIs("http") || url.SchemeIs("https"))) + (url.SchemeIs(chrome::kHttpScheme) || url.SchemeIs(chrome::kHttpsScheme))) chrome_browser_net::PreconnectUrlAndSubresources(url); } @@ -672,6 +673,7 @@ bool RenderViewHost::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityNotifications, OnAccessibilityNotifications) IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) + IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) #if defined(OS_MACOSX) IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnMsgShowPopup) #endif @@ -1254,6 +1256,28 @@ void RenderViewHost::OnScriptEvalResponse(int id, const ListValue& result) { Details<std::pair<int, Value*> >(&details)); } +void RenderViewHost::OnDidZoomURL(double zoom_level, + bool remember, + const GURL& url) { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + HostZoomMap* host_zoom_map = process()->profile()->GetHostZoomMap(); + if (remember) { + host_zoom_map->SetZoomLevel(url, zoom_level); + // Notify renderers from this profile. + for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); + !i.IsAtEnd(); i.Advance()) { + RenderProcessHost* render_process_host = i.GetCurrentValue(); + if (render_process_host->profile() == process()->profile()) { + render_process_host->Send( + new ViewMsg_SetZoomLevelForCurrentURL(url, zoom_level)); + } + } + } else { + host_zoom_map->SetTemporaryZoomLevel( + process()->id(), routing_id(), zoom_level); + } +} + #if defined(OS_MACOSX) void RenderViewHost::OnMsgShowPopup( const ViewHostMsg_ShowPopup_Params& params) { diff --git a/content/browser/tab_contents/tab_contents_observer.cc b/content/browser/tab_contents/tab_contents_observer.cc index ef06b0a7..100a836 100644 --- a/content/browser/tab_contents/tab_contents_observer.cc +++ b/content/browser/tab_contents/tab_contents_observer.cc @@ -26,8 +26,8 @@ void TabContentsObserver::Registrar::Observe(TabContents* tab) { } void TabContentsObserver::NavigateToPendingEntry( - const GURL& url, - NavigationController::ReloadType reload_type) { + const GURL& url, + NavigationController::ReloadType reload_type) { } void TabContentsObserver::DidNavigateMainFramePostCommit( diff --git a/content/plugin/webplugin_proxy.cc b/content/plugin/webplugin_proxy.cc index 5006b6c..e046f01 100644 --- a/content/plugin/webplugin_proxy.cc +++ b/content/plugin/webplugin_proxy.cc @@ -12,6 +12,7 @@ #include "build/build_config.h" #include "content/common/content_client.h" #include "content/common/plugin_messages.h" +#include "content/common/url_constants.h" #include "content/plugin/npobject_proxy.h" #include "content/plugin/npobject_util.h" #include "content/plugin/plugin_channel.h" @@ -289,9 +290,9 @@ void WebPluginProxy::HandleURLRequest(const char* url, webkit::npapi::WebPluginDelegateImpl:: PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS) { GURL request_url(url); - if (!request_url.SchemeIs("http") && - !request_url.SchemeIs("https") && - !request_url.SchemeIs("ftp")) { + if (!request_url.SchemeIs(chrome::kHttpScheme) && + !request_url.SchemeIs(chrome::kHttpsScheme) && + !request_url.SchemeIs(chrome::kFtpScheme)) { return; } } diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc index f7788e2..4cbe162 100644 --- a/content/renderer/render_view.cc +++ b/content/renderer/render_view.cc @@ -4105,7 +4105,7 @@ bool RenderView::IsNonLocalTopLevelNavigation( // 2. The origin of the url and the opener is the same in which case the // opener relationship is maintained. // 3. Reloads/form submits/back forward navigations - if (!url.SchemeIs("http") && !url.SchemeIs("https")) + if (!url.SchemeIs(chrome::kHttpScheme) && !url.SchemeIs(chrome::kHttpsScheme)) return false; // Not interested in reloads/form submits/resubmits/back forward navigations. |