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

Side by Side Diff: athena/extensions/shell/url_search_provider.cc

Issue 836213002: Assume all providers may give zero suggest responses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation issue in athena 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "athena/extensions/shell/url_search_provider.h" 5 #include "athena/extensions/shell/url_search_provider.h"
6 6
7 #include "athena/activity/public/activity.h" 7 #include "athena/activity/public/activity.h"
8 #include "athena/activity/public/activity_factory.h" 8 #include "athena/activity/public/activity_factory.h"
9 #include "athena/extensions/shell/athena_shell_scheme_classifier.h" 9 #include "athena/extensions/shell/athena_shell_scheme_classifier.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // TODO(hashimoto): Componentize HistoryURLProvider and remove this code. 246 // TODO(hashimoto): Componentize HistoryURLProvider and remove this code.
247 AutocompleteMatch what_you_typed_match( 247 AutocompleteMatch what_you_typed_match(
248 nullptr, 0, false, AutocompleteMatchType::URL_WHAT_YOU_TYPED); 248 nullptr, 0, false, AutocompleteMatchType::URL_WHAT_YOU_TYPED);
249 what_you_typed_match.destination_url = input_.canonicalized_url(); 249 what_you_typed_match.destination_url = input_.canonicalized_url();
250 what_you_typed_match.contents = input_.text(); 250 what_you_typed_match.contents = input_.text();
251 what_you_typed_match.relevance = kScoreForWhatYouTypedResult; 251 what_you_typed_match.relevance = kScoreForWhatYouTypedResult;
252 Add(scoped_ptr<app_list::SearchResult>( 252 Add(scoped_ptr<app_list::SearchResult>(
253 new UrlSearchResult(browser_context_, what_you_typed_match))); 253 new UrlSearchResult(browser_context_, what_you_typed_match)));
254 } 254 }
255 255
256 provider_->Start(input_, minimal_changes); 256 provider_->Start(input_, minimal_changes, false);
257 } 257 }
258 258
259 void UrlSearchProvider::Stop() { 259 void UrlSearchProvider::Stop() {
260 provider_->Stop(false); 260 provider_->Stop(false);
261 } 261 }
262 262
263 void UrlSearchProvider::OnProviderUpdate(bool updated_matches) { 263 void UrlSearchProvider::OnProviderUpdate(bool updated_matches) {
264 if (!updated_matches) 264 if (!updated_matches)
265 return; 265 return;
266 266
267 const ACMatches& matches = provider_->matches(); 267 const ACMatches& matches = provider_->matches();
268 for (ACMatches::const_iterator it = matches.begin(); it != matches.end(); 268 for (ACMatches::const_iterator it = matches.begin(); it != matches.end();
269 ++it) { 269 ++it) {
270 if (!it->destination_url.is_valid()) 270 if (!it->destination_url.is_valid())
271 continue; 271 continue;
272 272
273 Add(scoped_ptr<app_list::SearchResult>( 273 Add(scoped_ptr<app_list::SearchResult>(
274 new UrlSearchResult(browser_context_, *it))); 274 new UrlSearchResult(browser_context_, *it)));
275 } 275 }
276 } 276 }
277 277
278 } // namespace athena 278 } // namespace athena
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698