summaryrefslogtreecommitdiffstats
path: root/chrome_frame/utils.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-16 22:24:26 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-16 22:24:26 +0000
commit38d3d4295d2a71aadd5707b8152a438f3edb0d73 (patch)
treee4efae10f9b1c448649ee9f2ea78a306a576824c /chrome_frame/utils.cc
parentfb99efbe277cfb79219c50aa7e2071f684781a20 (diff)
downloadchromium_src-38d3d4295d2a71aadd5707b8152a438f3edb0d73.zip
chromium_src-38d3d4295d2a71aadd5707b8152a438f3edb0d73.tar.gz
chromium_src-38d3d4295d2a71aadd5707b8152a438f3edb0d73.tar.bz2
IE6 would not switch to ChromeFrame if the url being navigated to contained an anchor. This is presumably
because from IE6's perspecive nothing changed. To workaround this issue, we stash the complete url away in the navigation manager and remove it from the URL being navigated to. When the Chrome active document loads we read the actual url from the navigation manager and initiate a navigation to this URL. There is one issue with this approach though. The actual URL in the address bar in IE6 does not contain the anchor tag. Will address that in a follow up CL. This fixes bug http://code.google.com/p/chromium/issues/detail?id=38265 Bug=38265 Test=Covered by existing ChromeFrame anchor URL navigation tests. Review URL: http://codereview.chromium.org/1022003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41776 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.cc')
-rw-r--r--chrome_frame/utils.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc
index f58b47d..4e6b843 100644
--- a/chrome_frame/utils.cc
+++ b/chrome_frame/utils.cc
@@ -24,6 +24,7 @@
#include "chrome_frame/html_utils.h"
#include "chrome_frame/utils.h"
#include "googleurl/src/gurl.h"
+#include "googleurl/src/url_canon.h"
#include "grit/chrome_frame_resources.h"
// Note that these values are all lower case and are compared to
@@ -716,7 +717,22 @@ HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker,
DLOG(INFO) << __FUNCTION__ << " " << url;
ScopedComPtr<IWebBrowserPriv> browser_priv;
if (SUCCEEDED(hr = browser_priv.QueryFrom(web_browser2))) {
- ScopedVariant var_url(url);
+ GURL target_url(url);
+ // On IE6 if the original URL has a fragment then the navigation
+ // attempt is ignored. To workaround this we strip the fragment from
+ // the url and initiate the navigation. When the active document loads
+ // we retrieve the original url with the fragment from the Navigation
+ // manager and use it.
+ if (target_url.has_ref()) {
+ url_parse::Component comp;
+ GURL::Replacements replacements;
+ replacements.SetRef("", comp);
+
+ target_url = target_url.ReplaceComponents(replacements);
+ fragment = NULL;
+ }
+
+ ScopedVariant var_url(UTF8ToWide(target_url.spec()).c_str());
hr = browser_priv->NavigateWithBindCtx(var_url.AsInput(), NULL, NULL,
NULL, headers_var.AsInput(),
bind_ctx,