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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_controller.cc

Issue 1185723002: Prepare HistoryProvider for componentization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 5 years, 6 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
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/autocomplete/autocomplete_controller.h" 5 #include "chrome/browser/autocomplete/autocomplete_controller.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 done_(true), 182 done_(true),
183 in_start_(false), 183 in_start_(false),
184 template_url_service_(template_url_service) { 184 template_url_service_(template_url_service) {
185 provider_types &= ~OmniboxFieldTrial::GetDisabledProviderTypes(); 185 provider_types &= ~OmniboxFieldTrial::GetDisabledProviderTypes();
186 if (provider_types & AutocompleteProvider::TYPE_BOOKMARK) 186 if (provider_types & AutocompleteProvider::TYPE_BOOKMARK)
187 providers_.push_back(new BookmarkProvider(profile)); 187 providers_.push_back(new BookmarkProvider(profile));
188 if (provider_types & AutocompleteProvider::TYPE_BUILTIN) 188 if (provider_types & AutocompleteProvider::TYPE_BUILTIN)
189 providers_.push_back(new BuiltinProvider()); 189 providers_.push_back(new BuiltinProvider());
190 if (provider_types & AutocompleteProvider::TYPE_HISTORY_QUICK) { 190 if (provider_types & AutocompleteProvider::TYPE_HISTORY_QUICK) {
191 providers_.push_back(new HistoryQuickProvider( 191 providers_.push_back(new HistoryQuickProvider(
192 scoped_ptr<AutocompleteProviderClient>(
193 new ChromeAutocompleteProviderClient(profile)),
192 profile, InMemoryURLIndexFactory::GetForProfile(profile))); 194 profile, InMemoryURLIndexFactory::GetForProfile(profile)));
Peter Kasting 2015/06/12 16:20:22 It feels weird that right now these classes take b
blundell 2015/06/12 16:46:59 I'd prefer keep this structure even though it's ki
Peter Kasting 2015/06/12 17:02:20 How near is near future? If it's in the next week
blundell 2015/06/12 19:30:19 "Near future" is within a couple of weeks *unless*
blundell 2015/06/15 08:51:33 Changed to that model.
193 } 195 }
194 if (provider_types & AutocompleteProvider::TYPE_HISTORY_URL) { 196 if (provider_types & AutocompleteProvider::TYPE_HISTORY_URL) {
195 history_url_provider_ = new HistoryURLProvider(this, profile); 197 history_url_provider_ = new HistoryURLProvider(
198 scoped_ptr<AutocompleteProviderClient>(
199 new ChromeAutocompleteProviderClient(profile)),
200 this, profile);
196 providers_.push_back(history_url_provider_); 201 providers_.push_back(history_url_provider_);
197 } 202 }
198 // "Tab to search" can be used on all platforms other than Android. 203 // "Tab to search" can be used on all platforms other than Android.
199 #if !defined(OS_ANDROID) 204 #if !defined(OS_ANDROID)
200 if (provider_types & AutocompleteProvider::TYPE_KEYWORD) { 205 if (provider_types & AutocompleteProvider::TYPE_KEYWORD) {
201 keyword_provider_ = new KeywordProvider(this, template_url_service); 206 keyword_provider_ = new KeywordProvider(this, template_url_service);
202 #if defined(ENABLE_EXTENSIONS) 207 #if defined(ENABLE_EXTENSIONS)
203 keyword_provider_->set_extensions_delegate( 208 keyword_provider_->set_extensions_delegate(
204 scoped_ptr<KeywordExtensionsDelegate>( 209 scoped_ptr<KeywordExtensionsDelegate>(
205 new KeywordExtensionsDelegateImpl(profile, keyword_provider_))); 210 new KeywordExtensionsDelegateImpl(profile, keyword_provider_)));
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 expire_timer_.Stop(); 672 expire_timer_.Stop();
668 stop_timer_.Stop(); 673 stop_timer_.Stop();
669 done_ = true; 674 done_ = true;
670 if (clear_result && !result_.empty()) { 675 if (clear_result && !result_.empty()) {
671 result_.Reset(); 676 result_.Reset();
672 // NOTE: We pass in false since we're trying to only clear the popup, not 677 // NOTE: We pass in false since we're trying to only clear the popup, not
673 // touch the edit... this is all a mess and should be cleaned up :( 678 // touch the edit... this is all a mess and should be cleaned up :(
674 NotifyChanged(false); 679 NotifyChanged(false);
675 } 680 }
676 } 681 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698