| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |