summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_active_document.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 23:27:29 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 23:27:29 +0000
commit29c32f903806efbc167a417c170b896dfeecc33f (patch)
tree3c05f7208c27e1affa40d859b573f5a1a6bc66d8 /chrome_frame/chrome_active_document.cc
parent735f05d9e40970195459ac9136e8e731edea4f32 (diff)
downloadchromium_src-29c32f903806efbc167a417c170b896dfeecc33f.zip
chromium_src-29c32f903806efbc167a417c170b896dfeecc33f.tar.gz
chromium_src-29c32f903806efbc167a417c170b896dfeecc33f.tar.bz2
In ChromeFrame with the IMoniker patch on, we should save away the redirect information received for the initial pending request. This
is to ensure that we inform Chrome about this redirect which can then be followed correctly from Chrome. The other change is to save away the URL being navigated to in the bind context context object. This is also updated if we receive a redirect notification in our callback wrapper. The active document refers this URL if it is available and falls back to the old mechanism of retrieving the URL from the moniker if not. This ensures that optin urls continue to work correctly if the initial page is redirected. Review URL: http://codereview.chromium.org/1523028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45114 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_active_document.cc')
-rw-r--r--chrome_frame/chrome_active_document.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index d31b2a8..caa4ffd 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -35,6 +35,7 @@
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome_frame/bho.h"
+#include "chrome_frame/bind_context_info.h"
#include "chrome_frame/utils.h"
const wchar_t kChromeAttachExternalTabPrefix[] = L"attach_external_tab";
@@ -233,11 +234,20 @@ STDMETHODIMP ChromeActiveDocument::Load(BOOL fully_avalable,
NavigationManager* mgr = NavigationManager::GetThreadInstance();
DCHECK(mgr);
- // If the original URL contains an anchor, then the URL queried
- // from the moniker does not contain the anchor. To workaround
- // this we retrieve the URL from our BHO.
- std::wstring url(GetActualUrlFromMoniker(
- moniker_name, bind_context, mgr ? mgr->url(): std::wstring()));
+ std::wstring url;
+
+ scoped_refptr<BindContextInfo> info =
+ BindContextInfo::FromBindContext(bind_context);
+ DCHECK(info);
+ if (info && !info->url().empty()) {
+ url = info->url();
+ } else {
+ // If the original URL contains an anchor, then the URL queried
+ // from the moniker does not contain the anchor. To workaround
+ // this we retrieve the URL from our BHO.
+ url = GetActualUrlFromMoniker(moniker_name, bind_context,
+ mgr ? mgr->url(): std::wstring());
+ }
// The is_new_navigation variable indicates if this a navigation initiated
// by typing in a URL for e.g. in the IE address bar, or from Chrome by