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

Side by Side Diff: chrome/browser/ui/app_list/search/omnibox_provider.cc

Issue 1192373002: Prepare AutocompleteController for componentization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@componentize_zero_suggest_provider
Patch Set: Response to review 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/app_list/search/omnibox_provider.h" 5 #include "chrome/browser/ui/app_list/search/omnibox_provider.h"
6 6
7 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 7 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
8 #include "chrome/browser/autocomplete/autocomplete_controller.h" 8 #include "chrome/browser/autocomplete/autocomplete_controller.h"
9 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h"
9 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" 10 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
10 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/search_engines/template_url_service_factory.h" 12 #include "chrome/browser/search_engines/template_url_service_factory.h"
12 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 13 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
13 #include "chrome/browser/ui/app_list/search/omnibox_result.h" 14 #include "chrome/browser/ui/app_list/search/omnibox_result.h"
14 #include "components/metrics/proto/omnibox_event.pb.h" 15 #include "components/metrics/proto/omnibox_event.pb.h"
15 #include "components/omnibox/autocomplete_input.h" 16 #include "components/omnibox/autocomplete_input.h"
16 #include "ui/app_list/search_result.h" 17 #include "ui/app_list/search_result.h"
17 #include "url/gurl.h" 18 #include "url/gurl.h"
18 19
19 namespace app_list { 20 namespace app_list {
20 21
21 OmniboxProvider::OmniboxProvider(Profile* profile, 22 OmniboxProvider::OmniboxProvider(Profile* profile,
22 AppListControllerDelegate* list_controller) 23 AppListControllerDelegate* list_controller)
23 : profile_(profile), 24 : profile_(profile),
24 list_controller_(list_controller), 25 list_controller_(list_controller),
25 controller_(new AutocompleteController( 26 controller_(new AutocompleteController(
26 profile, 27 make_scoped_ptr(new ChromeAutocompleteProviderClient(profile)),
27 TemplateURLServiceFactory::GetForProfile(profile),
28 this, 28 this,
29 AutocompleteClassifier::kDefaultOmniboxProviders & 29 AutocompleteClassifier::kDefaultOmniboxProviders &
30 ~AutocompleteProvider::TYPE_ZERO_SUGGEST)), 30 ~AutocompleteProvider::TYPE_ZERO_SUGGEST)),
31 is_voice_query_(false) { 31 is_voice_query_(false) {
32 } 32 }
33 33
34 OmniboxProvider::~OmniboxProvider() {} 34 OmniboxProvider::~OmniboxProvider() {}
35 35
36 void OmniboxProvider::Start(bool is_voice_query, const base::string16& query) { 36 void OmniboxProvider::Start(bool is_voice_query, const base::string16& query) {
37 is_voice_query_ = is_voice_query; 37 is_voice_query_ = is_voice_query;
(...skipping 20 matching lines...) Expand all
58 profile_, list_controller_, controller_.get(), is_voice_query_, *it))); 58 profile_, list_controller_, controller_.get(), is_voice_query_, *it)));
59 } 59 }
60 } 60 }
61 61
62 void OmniboxProvider::OnResultChanged(bool default_match_changed) { 62 void OmniboxProvider::OnResultChanged(bool default_match_changed) {
63 const AutocompleteResult& result = controller_->result(); 63 const AutocompleteResult& result = controller_->result();
64 PopulateFromACResult(result); 64 PopulateFromACResult(result);
65 } 65 }
66 66
67 } // namespace app_list 67 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/search_provider_unittest.cc ('k') | chrome/browser/ui/omnibox/omnibox_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698