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

Unified Diff: chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc

Issue 58553003: Pass the AlternateNavInfoBarDelegate an AutocompleteMatch instead of a GURL. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 1 month 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
Index: chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc
===================================================================
--- chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc (revision 232852)
+++ chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc (working copy)
@@ -14,16 +14,17 @@
// static
void AlternateNavInfoBarDelegate::Create(InfoBarService* infobar_service,
- const GURL& alternate_nav_url) {
+ const AutocompleteMatch& match) {
infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
- new AlternateNavInfoBarDelegate(infobar_service, alternate_nav_url)));
+ new AlternateNavInfoBarDelegate(infobar_service, match)));
}
AlternateNavInfoBarDelegate::AlternateNavInfoBarDelegate(
InfoBarService* owner,
- const GURL& alternate_nav_url)
+ const AutocompleteMatch& match)
: InfoBarDelegate(owner),
- alternate_nav_url_(alternate_nav_url) {
+ match_(match) {
+ DCHECK(match_.destination_url.is_valid());
}
AlternateNavInfoBarDelegate::~AlternateNavInfoBarDelegate() {
@@ -37,7 +38,7 @@
}
string16 AlternateNavInfoBarDelegate::GetLinkText() const {
- return UTF8ToUTF16(alternate_nav_url_.spec());
+ return UTF8ToUTF16(match_.destination_url.spec());
}
bool AlternateNavInfoBarDelegate::LinkClicked(
@@ -45,7 +46,7 @@
// Pretend the user typed this URL, so that navigating to it will be the
// default action when it's typed again in the future.
web_contents()->OpenURL(content::OpenURLParams(
- alternate_nav_url_, content::Referrer(), disposition,
+ match_.destination_url, content::Referrer(), disposition,
content::PAGE_TRANSITION_TYPED, false));
// We should always close, even if the navigation did not occur within this
« no previous file with comments | « chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h ('k') | chrome/browser/ui/omnibox/omnibox_edit_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698