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

Side by Side Diff: chrome/browser/ui/search_engines/search_engine_tab_helper.cc

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Addressed comments + rebase Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/loader/async_revalidation_manager_unittest.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/search_engines/search_engine_tab_helper.h" 5 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" 10 #include "chrome/browser/search_engines/template_url_fetcher_factory.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return base::string16(); 66 return base::string16();
67 } 67 }
68 68
69 return TemplateURL::GenerateKeyword(url); 69 return TemplateURL::GenerateKeyword(url);
70 } 70 }
71 71
72 void AssociateURLFetcherWithWebContents(content::WebContents* web_contents, 72 void AssociateURLFetcherWithWebContents(content::WebContents* web_contents,
73 net::URLFetcher* url_fetcher) { 73 net::URLFetcher* url_fetcher) {
74 content::AssociateURLFetcherWithRenderFrame( 74 content::AssociateURLFetcherWithRenderFrame(
75 url_fetcher, 75 url_fetcher,
76 web_contents->GetURL(), 76 url::Origin(web_contents->GetURL()),
77 web_contents->GetRenderProcessHost()->GetID(), 77 web_contents->GetRenderProcessHost()->GetID(),
78 web_contents->GetMainFrame()->GetRoutingID()); 78 web_contents->GetMainFrame()->GetRoutingID());
79 } 79 }
80 80
81 } // namespace 81 } // namespace
82 82
83 SearchEngineTabHelper::~SearchEngineTabHelper() { 83 SearchEngineTabHelper::~SearchEngineTabHelper() {
84 } 84 }
85 85
86 void SearchEngineTabHelper::DidNavigateMainFrame( 86 void SearchEngineTabHelper::DidNavigateMainFrame(
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // the favicon url wasn't obtained before the load started. This assumes the 214 // the favicon url wasn't obtained before the load started. This assumes the
215 // latter. 215 // latter.
216 // TODO(sky): Need a way to set the favicon that doesn't involve generating 216 // TODO(sky): Need a way to set the favicon that doesn't involve generating
217 // its url. 217 // its url.
218 data.favicon_url = current_favicon.is_valid() ? 218 data.favicon_url = current_favicon.is_valid() ?
219 current_favicon : TemplateURL::GenerateFaviconURL(params.referrer.url); 219 current_favicon : TemplateURL::GenerateFaviconURL(params.referrer.url);
220 data.safe_for_autoreplace = true; 220 data.safe_for_autoreplace = true;
221 data.input_encodings.push_back(params.searchable_form_encoding); 221 data.input_encodings.push_back(params.searchable_form_encoding);
222 url_service->Add(base::MakeUnique<TemplateURL>(data)); 222 url_service->Add(base::MakeUnique<TemplateURL>(data));
223 } 223 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/loader/async_revalidation_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698