diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-27 23:01:50 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-27 23:01:50 +0000 |
commit | c058805b99cce98cbc352c499f3e69fd355a84c2 (patch) | |
tree | 93fb4ffdf5daf4d8ae0e3291919a074a8b9e58a7 /chrome/browser/dom_ui | |
parent | f07cc2ebf950cb22c5c386f95a1be0292de4db3b (diff) | |
download | chromium_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/dom_ui')
-rw-r--r-- | chrome/browser/dom_ui/new_tab_ui.cc | 8 | ||||
-rw-r--r-- | chrome/browser/dom_ui/new_tab_ui.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index 441d8ea..ff3e997e 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -459,7 +459,7 @@ void TemplateURLHandler::HandleDoSearch(const Value* content) { // Load the URL. if (!url.empty()) { - dom_ui_host_->OpenURL(GURL(WideToUTF8(url)), CURRENT_TAB, + dom_ui_host_->OpenURL(GURL(WideToUTF8(url)), GURL(), CURRENT_TAB, PageTransition::LINK); } } @@ -673,7 +673,7 @@ HistoryHandler::HistoryHandler(DOMUIHost* dom_ui_host) void HistoryHandler::HandleShowHistoryPage(const Value*) { NavigationController* controller = dom_ui_host_->controller(); if (controller) - controller->LoadURL(HistoryTabUI::GetURL(), PageTransition::LINK); + controller->LoadURL(HistoryTabUI::GetURL(), GURL(), PageTransition::LINK); } void HistoryHandler::HandleSearchHistoryPage(const Value* content) { @@ -689,6 +689,7 @@ void HistoryHandler::HandleSearchHistoryPage(const Value* content) { NavigationController* controller = dom_ui_host_->controller(); controller->LoadURL( HistoryTabUI::GetHistoryURLWithSearchText(wstring_value), + GURL(), PageTransition::LINK); } } @@ -807,13 +808,14 @@ bool NewTabUIContents::SupportsURL(GURL* url) { } void NewTabUIContents::RequestOpenURL(const GURL& url, + const GURL& /*referrer*/, WindowOpenDisposition disposition) { // The user opened a URL on the page (including "open in new window"). // We count all such clicks as AUTO_BOOKMARK, which increments the site's // visit count (which is used for ranking the most visited entries). // Note this means we're including clicks on not only most visited thumbnails, // but also clicks on recently bookmarked. - OpenURL(url, disposition, PageTransition::AUTO_BOOKMARK); + OpenURL(url, GURL(), disposition, PageTransition::AUTO_BOOKMARK); // Figure out if this was a click on a MostVisited entry, and log it if so. if (most_visited_handler_) { diff --git a/chrome/browser/dom_ui/new_tab_ui.h b/chrome/browser/dom_ui/new_tab_ui.h index 702f06e..9c18a60 100644 --- a/chrome/browser/dom_ui/new_tab_ui.h +++ b/chrome/browser/dom_ui/new_tab_ui.h @@ -300,7 +300,7 @@ class NewTabUIContents : public DOMUIHost { virtual bool ShouldDisplayURL() { return false; } virtual bool SupportsURL(GURL* url); // Clicking a URL on the page should count as an autobookmark click. - virtual void RequestOpenURL(const GURL& url, + virtual void RequestOpenURL(const GURL& url, const GURL& referrer, WindowOpenDisposition disposition); private: // The message id that should be displayed in this NewTabUIContents |