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

Unified Diff: chrome/browser/ui/omnibox/omnibox_navigation_observer.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
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_navigation_observer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_navigation_observer.cc
===================================================================
--- chrome/browser/ui/omnibox/omnibox_navigation_observer.cc (revision 232852)
+++ chrome/browser/ui/omnibox/omnibox_navigation_observer.cc (working copy)
@@ -54,15 +54,15 @@
Profile* profile,
const string16& text,
const AutocompleteMatch& match,
- const GURL& alternate_nav_url)
+ const AutocompleteMatch& alternate_nav_match)
: text_(text),
match_(match),
- alternate_nav_url_(alternate_nav_url),
+ alternate_nav_match_(alternate_nav_match),
shortcuts_backend_(ShortcutsBackendFactory::GetForProfile(profile)),
load_state_(LOAD_NOT_SEEN),
fetch_state_(FETCH_NOT_COMPLETE) {
- if (alternate_nav_url_.is_valid()) {
- fetcher_.reset(net::URLFetcher::Create(alternate_nav_url,
+ if (alternate_nav_match_.destination_url.is_valid()) {
+ fetcher_.reset(net::URLFetcher::Create(alternate_nav_match_.destination_url,
net::URLFetcher::HEAD, this));
fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
fetcher_->SetStopOnRedirect(true);
@@ -134,7 +134,8 @@
(status.is_success() && ResponseCodeIndicatesSuccess(response_code)) ||
((status.status() == net::URLRequestStatus::CANCELED) &&
((response_code / 100) == 3) &&
- IsValidNavigation(alternate_nav_url_, source->GetURL())) ?
+ IsValidNavigation(alternate_nav_match_.destination_url,
+ source->GetURL())) ?
FETCH_SUCCEEDED : FETCH_FAILED;
if (load_state_ == LOAD_COMMITTED)
OnAllLoadingFinished(); // deletes |this|!
@@ -143,7 +144,7 @@
void OmniboxNavigationObserver::OnAllLoadingFinished() {
if (fetch_state_ == FETCH_SUCCEEDED) {
AlternateNavInfoBarDelegate::Create(
- InfoBarService::FromWebContents(web_contents()), alternate_nav_url_);
+ InfoBarService::FromWebContents(web_contents()), alternate_nav_match_);
}
delete this;
}
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_navigation_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698