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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_navigation_observer.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/app_list/start_page_service.cc ('k') | chrome/browser/ui/webui/about_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/omnibox/omnibox_navigation_observer.h" 5 #include "chrome/browser/ui/omnibox/omnibox_navigation_observer.h"
6 6
7 #include "chrome/browser/autocomplete/shortcuts_backend.h" 7 #include "chrome/browser/autocomplete/shortcuts_backend.h"
8 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" 8 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
9 #include "chrome/browser/infobars/infobar_service.h" 9 #include "chrome/browser/infobars/infobar_service.h"
10 #include "chrome/browser/intranet_redirect_detector.h" 10 #include "chrome/browser/intranet_redirect_detector.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 const base::string16& text, 56 const base::string16& text,
57 const AutocompleteMatch& match, 57 const AutocompleteMatch& match,
58 const AutocompleteMatch& alternate_nav_match) 58 const AutocompleteMatch& alternate_nav_match)
59 : text_(text), 59 : text_(text),
60 match_(match), 60 match_(match),
61 alternate_nav_match_(alternate_nav_match), 61 alternate_nav_match_(alternate_nav_match),
62 shortcuts_backend_(ShortcutsBackendFactory::GetForProfile(profile)), 62 shortcuts_backend_(ShortcutsBackendFactory::GetForProfile(profile)),
63 load_state_(LOAD_NOT_SEEN), 63 load_state_(LOAD_NOT_SEEN),
64 fetch_state_(FETCH_NOT_COMPLETE) { 64 fetch_state_(FETCH_NOT_COMPLETE) {
65 if (alternate_nav_match_.destination_url.is_valid()) { 65 if (alternate_nav_match_.destination_url.is_valid()) {
66 fetcher_.reset(net::URLFetcher::Create(alternate_nav_match_.destination_url, 66 fetcher_ = net::URLFetcher::Create(alternate_nav_match_.destination_url,
67 net::URLFetcher::HEAD, this)); 67 net::URLFetcher::HEAD, this);
68 fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); 68 fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
69 fetcher_->SetStopOnRedirect(true); 69 fetcher_->SetStopOnRedirect(true);
70 } 70 }
71 // We need to start by listening to AllSources, since we don't know which tab 71 // We need to start by listening to AllSources, since we don't know which tab
72 // the navigation might occur in. 72 // the navigation might occur in.
73 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_PENDING, 73 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_PENDING,
74 content::NotificationService::AllSources()); 74 content::NotificationService::AllSources());
75 } 75 }
76 76
77 OmniboxNavigationObserver::~OmniboxNavigationObserver() { 77 OmniboxNavigationObserver::~OmniboxNavigationObserver() {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 OnAllLoadingFinished(); // deletes |this|! 173 OnAllLoadingFinished(); // deletes |this|!
174 } 174 }
175 175
176 void OmniboxNavigationObserver::OnAllLoadingFinished() { 176 void OmniboxNavigationObserver::OnAllLoadingFinished() {
177 if (fetch_state_ == FETCH_SUCCEEDED) { 177 if (fetch_state_ == FETCH_SUCCEEDED) {
178 AlternateNavInfoBarDelegate::Create( 178 AlternateNavInfoBarDelegate::Create(
179 web_contents(), text_, alternate_nav_match_, match_.destination_url); 179 web_contents(), text_, alternate_nav_match_, match_.destination_url);
180 } 180 }
181 delete this; 181 delete this;
182 } 182 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/start_page_service.cc ('k') | chrome/browser/ui/webui/about_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698