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

Side by Side Diff: chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc

Issue 839193002: Move ServiceAccessType into //components/keyed_service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on android Created 5 years, 11 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/ui/webui/omnibox/omnibox_ui_handler.h" 5 #include "chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 GURL(result_by_provider.results[j]->destination_url)); 155 GURL(result_by_provider.results[j]->destination_url));
156 } 156 }
157 } 157 }
158 } 158 }
159 159
160 client()->HandleNewAutocompleteResult(result.Pass()); 160 client()->HandleNewAutocompleteResult(result.Pass());
161 } 161 }
162 162
163 bool OmniboxUIHandler::LookupIsTypedHost(const base::string16& host, 163 bool OmniboxUIHandler::LookupIsTypedHost(const base::string16& host,
164 bool* is_typed_host) const { 164 bool* is_typed_host) const {
165 HistoryService* const history_service = 165 HistoryService* const history_service = HistoryServiceFactory::GetForProfile(
166 HistoryServiceFactory::GetForProfile(profile_, 166 profile_, ServiceAccessType::EXPLICIT_ACCESS);
167 Profile::EXPLICIT_ACCESS);
168 if (!history_service) 167 if (!history_service)
169 return false; 168 return false;
170 history::URLDatabase* url_db = history_service->InMemoryDatabase(); 169 history::URLDatabase* url_db = history_service->InMemoryDatabase();
171 if (!url_db) 170 if (!url_db)
172 return false; 171 return false;
173 *is_typed_host = url_db->IsTypedHost(base::UTF16ToUTF8(host)); 172 *is_typed_host = url_db->IsTypedHost(base::UTF16ToUTF8(host));
174 return true; 173 return true;
175 } 174 }
176 175
177 void OmniboxUIHandler::StartOmniboxQuery(const mojo::String& input_string, 176 void OmniboxUIHandler::StartOmniboxQuery(const mojo::String& input_string,
(...skipping 16 matching lines...) Expand all
194 ChromeAutocompleteSchemeClassifier(profile_)); 193 ChromeAutocompleteSchemeClassifier(profile_));
195 controller_->Start(input_); 194 controller_->Start(input_);
196 } 195 }
197 196
198 void OmniboxUIHandler::ResetController() { 197 void OmniboxUIHandler::ResetController() {
199 controller_.reset(new AutocompleteController(profile_, 198 controller_.reset(new AutocompleteController(profile_,
200 TemplateURLServiceFactory::GetForProfile(profile_), 199 TemplateURLServiceFactory::GetForProfile(profile_),
201 this, 200 this,
202 AutocompleteClassifier::kDefaultOmniboxProviders)); 201 AutocompleteClassifier::kDefaultOmniboxProviders));
203 } 202 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/suggestions_source_top_sites.cc ('k') | chrome/browser/webdata/web_data_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698