Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5776)

Unified Diff: chrome_frame/chrome_active_document.cc

Issue 274071: When Chrome hands off a URL to be opened by the external host by the ViewHost... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/chrome_active_document.h ('k') | chrome_frame/chrome_frame_activex_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/chrome_active_document.cc
===================================================================
--- chrome_frame/chrome_active_document.cc (revision 29317)
+++ chrome_frame/chrome_active_document.cc (working copy)
@@ -33,6 +33,7 @@
#include "chrome/common/navigation_types.h"
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
+#include "chrome_frame/bho.h"
#include "chrome_frame/utils.h"
const wchar_t kChromeAttachExternalTabPrefix[] = L"attach_external_tab";
@@ -521,7 +522,7 @@
DCHECK(navigation_info_.url.is_valid());
std::string url_to_open = "view-source:";
url_to_open += navigation_info_.url.spec();
- OnOpenURL(0, GURL(url_to_open), NEW_WINDOW);
+ OnOpenURL(0, GURL(url_to_open), GURL(), NEW_WINDOW);
}
void ChromeActiveDocument::OnDetermineSecurityZone(const GUID* cmd_group_guid,
@@ -535,7 +536,9 @@
}
}
-void ChromeActiveDocument::OnOpenURL(int tab_handle, const GURL& url_to_open,
+void ChromeActiveDocument::OnOpenURL(int tab_handle,
+ const GURL& url_to_open,
+ const GURL& referrer,
int open_disposition) {
// If the disposition indicates that we should be opening the URL in the
// current tab, then we can reuse the ChromeFrameAutomationClient instance
@@ -548,7 +551,7 @@
g_active_doc_cache.Set(this);
}
- Base::OnOpenURL(tab_handle, url_to_open, open_disposition);
+ Base::OnOpenURL(tab_handle, url_to_open, referrer, open_disposition);
}
void ChromeActiveDocument::OnLoad(int tab_handle, const GURL& url) {
@@ -723,7 +726,16 @@
if (url_.Length()) {
std::string utf8_url;
WideToUTF8(url_, url_.Length(), &utf8_url);
- if (!automation_client_->InitiateNavigation(utf8_url, is_privileged_)) {
+
+ std::string referrer;
+ Bho* chrome_frame_bho = Bho::GetCurrentThreadBhoInstance();
+ DCHECK(chrome_frame_bho != NULL);
+ if (chrome_frame_bho) {
+ referrer = chrome_frame_bho->referrer();
+ }
+ if (!automation_client_->InitiateNavigation(utf8_url,
+ referrer,
+ is_privileged_)) {
DLOG(ERROR) << "Invalid URL: " << url;
Error(L"Invalid URL");
url_.Reset();
« no previous file with comments | « chrome_frame/chrome_active_document.h ('k') | chrome_frame/chrome_frame_activex_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698