Plumb the referrer throughout the OpenURL APIs.
http://code.google.com/p/chromium/issues/detail?id=3224
Caveats:
* Did not update TabNavigation yet. Hence session restore will continue to load the tabs with empty referrer.
* Did not plumb referrer into incognito url open. (Not sure what the right thing to do is here with respect to privacy vs compatibility.)
* Did not plumb referrer throughout the automation controller. No functional impact here, but it makes the code inconsistent with the non-automation version.
Review URL: http://codereview.chromium.org/8186
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4036 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/tab_contents.cc b/chrome/browser/tab_contents.cc
index 1a80995b..931d415 100644
--- a/chrome/browser/tab_contents.cc
+++ b/chrome/browser/tab_contents.cc
@@ -242,11 +242,11 @@
delegate_->ActivateContents(this);
}
-void TabContents::OpenURL(const GURL& url,
+void TabContents::OpenURL(const GURL& url, const GURL& referrer,
WindowOpenDisposition disposition,
PageTransition::Type transition) {
if (delegate_)
- delegate_->OpenURLFromTab(this, url, disposition, transition);
+ delegate_->OpenURLFromTab(this, url, referrer, disposition, transition);
}
bool TabContents::NavigateToPendingEntry(bool reload) {
@@ -454,9 +454,10 @@
void TabContents::OpenURL(ConstrainedWindow* window,
const GURL& url,
+ const GURL& referrer,
WindowOpenDisposition disposition,
PageTransition::Type transition) {
- OpenURL(url, disposition, transition);
+ OpenURL(url, referrer, disposition, transition);
}
void TabContents::WillClose(ConstrainedWindow* window) {