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

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

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