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

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

Issue 735683002: SearchEngineTabHelper: added delegate_ member initializer to constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | no next file » | 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 "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" 8 #include "chrome/browser/search_engines/template_url_fetcher_factory.h"
9 #include "chrome/browser/search_engines/template_url_service_factory.h" 9 #include "chrome/browser/search_engines/template_url_service_factory.h"
10 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" 10 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 IPC_BEGIN_MESSAGE_MAP(SearchEngineTabHelper, message) 89 IPC_BEGIN_MESSAGE_MAP(SearchEngineTabHelper, message)
90 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_PageHasOSDD, OnPageHasOSDD) 90 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_PageHasOSDD, OnPageHasOSDD)
91 IPC_MESSAGE_UNHANDLED(handled = false) 91 IPC_MESSAGE_UNHANDLED(handled = false)
92 IPC_END_MESSAGE_MAP() 92 IPC_END_MESSAGE_MAP()
93 93
94 return handled; 94 return handled;
95 } 95 }
96 96
97 SearchEngineTabHelper::SearchEngineTabHelper(WebContents* web_contents) 97 SearchEngineTabHelper::SearchEngineTabHelper(WebContents* web_contents)
98 : content::WebContentsObserver(web_contents), 98 : content::WebContentsObserver(web_contents),
99 delegate_(nullptr),
99 weak_ptr_factory_(this) { 100 weak_ptr_factory_(this) {
100 DCHECK(web_contents); 101 DCHECK(web_contents);
101 } 102 }
102 103
103 void SearchEngineTabHelper::OnPageHasOSDD( 104 void SearchEngineTabHelper::OnPageHasOSDD(
104 const GURL& page_url, 105 const GURL& page_url,
105 const GURL& osdd_url, 106 const GURL& osdd_url,
106 const search_provider::OSDDType& msg_provider_type) { 107 const search_provider::OSDDType& msg_provider_type) {
107 // Checks to see if we should generate a keyword based on the OSDD, and if 108 // Checks to see if we should generate a keyword based on the OSDD, and if
108 // necessary uses TemplateURLFetcher to download the OSDD and create a 109 // necessary uses TemplateURLFetcher to download the OSDD and create a
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // the favicon url wasn't obtained before the load started. This assumes the 220 // the favicon url wasn't obtained before the load started. This assumes the
220 // latter. 221 // latter.
221 // TODO(sky): Need a way to set the favicon that doesn't involve generating 222 // TODO(sky): Need a way to set the favicon that doesn't involve generating
222 // its url. 223 // its url.
223 data.favicon_url = current_favicon.is_valid() ? 224 data.favicon_url = current_favicon.is_valid() ?
224 current_favicon : TemplateURL::GenerateFaviconURL(params.referrer.url); 225 current_favicon : TemplateURL::GenerateFaviconURL(params.referrer.url);
225 data.safe_for_autoreplace = true; 226 data.safe_for_autoreplace = true;
226 data.input_encodings.push_back(params.searchable_form_encoding); 227 data.input_encodings.push_back(params.searchable_form_encoding);
227 url_service->Add(new TemplateURL(data)); 228 url_service->Add(new TemplateURL(data));
228 } 229 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698