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

Unified Diff: chrome/browser/navigation_controller.cc

Issue 8186: Plumb the referrer throughout the OpenURL APIs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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/browser/navigation_controller.h ('k') | chrome/browser/navigation_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/navigation_controller.cc
===================================================================
--- chrome/browser/navigation_controller.cc (revision 3991)
+++ chrome/browser/navigation_controller.cc (working copy)
@@ -146,10 +146,11 @@
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 @@
} 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 @@
}
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 @@
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 @@
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);
« no previous file with comments | « chrome/browser/navigation_controller.h ('k') | chrome/browser/navigation_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698