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

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

Issue 354773002: Reduces dependency from AutocompleteMatch to Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 | Annotate | Revision Log
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/autocomplete_match.h" 9 #include "chrome/browser/autocomplete/autocomplete_match.h"
10 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" 10 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
11 #include "chrome/browser/autocomplete/search_provider.h" 11 #include "chrome/browser/autocomplete/search_provider.h"
12 #include "chrome/browser/search_engines/template_url_service_factory.h"
12 #include "chrome/browser/ui/app_list/search/chrome_search_result.h" 13 #include "chrome/browser/ui/app_list/search/chrome_search_result.h"
13 #include "chrome/browser/ui/browser_navigator.h" 14 #include "chrome/browser/ui/browser_navigator.h"
14 #include "components/autocomplete/autocomplete_input.h" 15 #include "components/autocomplete/autocomplete_input.h"
15 #include "components/metrics/proto/omnibox_event.pb.h" 16 #include "components/metrics/proto/omnibox_event.pb.h"
16 #include "grit/theme_resources.h" 17 #include "grit/theme_resources.h"
17 #include "ui/base/resource/resource_bundle.h" 18 #include "ui/base/resource/resource_bundle.h"
18 19
19 namespace app_list { 20 namespace app_list {
20 21
21 namespace { 22 namespace {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 130
130 DISALLOW_COPY_AND_ASSIGN(OmniboxResult); 131 DISALLOW_COPY_AND_ASSIGN(OmniboxResult);
131 }; 132 };
132 133
133 } // namespace 134 } // namespace
134 135
135 OmniboxProvider::OmniboxProvider(Profile* profile) 136 OmniboxProvider::OmniboxProvider(Profile* profile)
136 : profile_(profile), 137 : profile_(profile),
137 controller_(new AutocompleteController( 138 controller_(new AutocompleteController(
138 profile, 139 profile,
140 TemplateURLServiceFactory::GetForProfile(profile),
139 this, 141 this,
140 AutocompleteClassifier::kDefaultOmniboxProviders & 142 AutocompleteClassifier::kDefaultOmniboxProviders &
141 ~AutocompleteProvider::TYPE_ZERO_SUGGEST)) { 143 ~AutocompleteProvider::TYPE_ZERO_SUGGEST)) {
142 controller_->search_provider()->set_in_app_list(); 144 controller_->search_provider()->set_in_app_list();
143 } 145 }
144 146
145 OmniboxProvider::~OmniboxProvider() {} 147 OmniboxProvider::~OmniboxProvider() {}
146 148
147 void OmniboxProvider::Start(const base::string16& query) { 149 void OmniboxProvider::Start(const base::string16& query) {
148 controller_->Start(AutocompleteInput( 150 controller_->Start(AutocompleteInput(
(...skipping 17 matching lines...) Expand all
166 Add(scoped_ptr<SearchResult>(new OmniboxResult(profile_, *it))); 168 Add(scoped_ptr<SearchResult>(new OmniboxResult(profile_, *it)));
167 } 169 }
168 } 170 }
169 171
170 void OmniboxProvider::OnResultChanged(bool default_match_changed) { 172 void OmniboxProvider::OnResultChanged(bool default_match_changed) {
171 const AutocompleteResult& result = controller_->result(); 173 const AutocompleteResult& result = controller_->result();
172 PopulateFromACResult(result); 174 PopulateFromACResult(result);
173 } 175 }
174 176
175 } // namespace app_list 177 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/shortcuts_provider.cc ('k') | chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698