summaryrefslogtreecommitdiffstats
path: root/chrome/browser/navigation_controller.cc
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-27 23:01:50 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-27 23:01:50 +0000
commitc058805b99cce98cbc352c499f3e69fd355a84c2 (patch)
tree93fb4ffdf5daf4d8ae0e3291919a074a8b9e58a7 /chrome/browser/navigation_controller.cc
parentf07cc2ebf950cb22c5c386f95a1be0292de4db3b (diff)
downloadchromium_src-c058805b99cce98cbc352c499f3e69fd355a84c2.zip
chromium_src-c058805b99cce98cbc352c499f3e69fd355a84c2.tar.gz
chromium_src-c058805b99cce98cbc352c499f3e69fd355a84c2.tar.bz2
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
Diffstat (limited to 'chrome/browser/navigation_controller.cc')
-rw-r--r--chrome/browser/navigation_controller.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/navigation_controller.cc b/chrome/browser/navigation_controller.cc
index c3b4304..d646bb1 100644
--- a/chrome/browser/navigation_controller.cc
+++ b/chrome/browser/navigation_controller.cc
@@ -146,10 +146,11 @@ static void CreateNavigationEntriesFromTabNavigations(
NavigationEntry* entry = new NavigationEntry(
type,
- NULL, // The site instance for restored tabs is sent on naviagion
+ NULL, // The site instance for restored tabs is sent on naviagtion
// (WebContents::GetSiteInstanceForEntry).
static_cast<int>(i - navigations.begin()),
real_url,
+ GURL(), // TODO(eroman): should pass actual referrer.
navigation.title,
// Use a transition type of reload so that we don't incorrectly
// increase the typed count.
@@ -408,7 +409,7 @@ void NavigationController::RemoveEntryAtIndex(int index,
} else {
// If there is nothing to show, show a default page.
LoadURL(default_url.is_empty() ? GURL("about:blank") : default_url,
- PageTransition::START_PAGE);
+ GURL(), PageTransition::START_PAGE);
}
} else if (last_committed_entry_index_ > index) {
last_committed_entry_index_--;
@@ -477,7 +478,7 @@ void NavigationController::TabContentsWasDestroyed(TabContentsType type) {
}
NavigationEntry* NavigationController::CreateNavigationEntry(
- const GURL& url, PageTransition::Type transition) {
+ const GURL& url, const GURL& referrer, PageTransition::Type transition) {
GURL real_url = url;
TabContentsType type;
@@ -490,6 +491,7 @@ NavigationEntry* NavigationController::CreateNavigationEntry(
type = TabContents::TypeForURL(&real_url);
NavigationEntry* entry = new NavigationEntry(type, NULL, -1, real_url,
+ referrer,
std::wstring(), transition);
entry->set_display_url(url);
entry->set_user_typed_url(url);
@@ -512,21 +514,22 @@ void NavigationController::AddTransientEntry(NavigationEntry* entry) {
TabContents::INVALIDATE_EVERYTHING);
}
-void NavigationController::LoadURL(const GURL& url,
+void NavigationController::LoadURL(const GURL& url, const GURL& referrer,
PageTransition::Type transition) {
// The user initiated a load, we don't need to reload anymore.
needs_reload_ = false;
- NavigationEntry* entry = CreateNavigationEntry(url, transition);
+ NavigationEntry* entry = CreateNavigationEntry(url, referrer, transition);
LoadEntry(entry);
}
void NavigationController::LoadURLLazily(const GURL& url,
+ const GURL& referrer,
PageTransition::Type type,
const std::wstring& title,
SkBitmap* icon) {
- NavigationEntry* entry = CreateNavigationEntry(url, type);
+ NavigationEntry* entry = CreateNavigationEntry(url, referrer, type);
entry->set_title(title);
if (icon)
entry->favicon().set_bitmap(*icon);