diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-05 06:34:19 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-05 06:34:19 +0000 |
commit | ebb6688ed7dca75b3a899deab7135b146ddb7716 (patch) | |
tree | c382086ff67f39f7915dd92550b6215ed8496000 /chrome | |
parent | 26b9816a2f7b37b5ed30e415aefa333e3a4f6111 (diff) | |
download | chromium_src-ebb6688ed7dca75b3a899deab7135b146ddb7716.zip chromium_src-ebb6688ed7dca75b3a899deab7135b146ddb7716.tar.gz chromium_src-ebb6688ed7dca75b3a899deab7135b146ddb7716.tar.bz2 |
Don't start the throbber when loading javascript URLs. This fixes a
regression from my "start the throbber sooner" patch that made JS URLs keep
throbbing forever.
This patch just adds a check to see if the URL is JS, and doesn't synthesize
the load start message. It seems kind of like a hcak, but I think it's the
right thing. As I argued in the last patch (the comment for the block I
modified here), we really need the throbbing status to be synchronous. This
means we need to basically duplicate the logic for when WebKit will do the
throbber in this function.
BUG=11422
Review URL: http://codereview.chromium.org/105009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15280 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 13 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.h | 5 |
2 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 6fd6a46..7d19fe3 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -197,7 +197,7 @@ void RenderViewHost::NavigateToEntry(const NavigationEntry& entry, RendererSecurityPolicy::GetInstance()->GrantRequestURL( process()->pid(), params.url); - DoNavigate(new ViewMsg_Navigate(routing_id(), params)); + DoNavigate(entry.url(), new ViewMsg_Navigate(routing_id(), params)); } void RenderViewHost::NavigateToURL(const GURL& url) { @@ -210,10 +210,11 @@ void RenderViewHost::NavigateToURL(const GURL& url) { RendererSecurityPolicy::GetInstance()->GrantRequestURL( process()->pid(), params.url); - DoNavigate(new ViewMsg_Navigate(routing_id(), params)); + DoNavigate(url, new ViewMsg_Navigate(routing_id(), params)); } -void RenderViewHost::DoNavigate(ViewMsg_Navigate* nav_message) { +void RenderViewHost::DoNavigate(const GURL& url, + ViewMsg_Navigate* nav_message) { // Only send the message if we aren't suspended at the start of a cross-site // request. if (navigations_suspended_) { @@ -234,7 +235,11 @@ void RenderViewHost::DoNavigate(ViewMsg_Navigate* nav_message) { // with the throbber starting because the DOMUI (which controls whether the // favicon is displayed) happens synchronously. If the start loading // messages was asynchronous, then the default favicon would flash in. - delegate_->DidStartLoading(this); + // + // WebKit doesn't send throb notifications for JavaScript URLs, so we + // don't want to either. + if (!url.SchemeIs(chrome::kJavaScriptScheme)) + delegate_->DidStartLoading(this); } } diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index d0eed0b..50b5dff 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -547,7 +547,10 @@ class RenderViewHost : public RenderWidgetHost { // Helper function to send a navigation message. If a cross-site request is // in progress, we may be suspended while waiting for the onbeforeunload // handler, so this function might buffer the message rather than sending it. - void DoNavigate(ViewMsg_Navigate* nav_message); + // + // The URL parameter should match the one in the message. It's provided so + // that we don't have to decode the message to check it. + void DoNavigate(const GURL& url, ViewMsg_Navigate* nav_message); private: friend class TestRenderViewHost; |