| OLD | NEW |
| 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/autocomplete/zero_suggest_provider.h" | 5 #include "chrome/browser/autocomplete/zero_suggest_provider.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/i18n/case_conversion.h" | 8 #include "base/i18n/case_conversion.h" |
| 9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 449 |
| 450 AutocompleteMatch ZeroSuggestProvider::MatchForCurrentURL() { | 450 AutocompleteMatch ZeroSuggestProvider::MatchForCurrentURL() { |
| 451 AutocompleteInput input(permanent_text_, string16::npos, string16(), | 451 AutocompleteInput input(permanent_text_, string16::npos, string16(), |
| 452 GURL(current_query_), current_page_classification_, | 452 GURL(current_query_), current_page_classification_, |
| 453 false, false, true, AutocompleteInput::ALL_MATCHES); | 453 false, false, true, AutocompleteInput::ALL_MATCHES); |
| 454 | 454 |
| 455 AutocompleteMatch match( | 455 AutocompleteMatch match( |
| 456 HistoryURLProvider::SuggestExactInput(this, input, | 456 HistoryURLProvider::SuggestExactInput(this, input, |
| 457 !HasHTTPScheme(input.text()))); | 457 !HasHTTPScheme(input.text()))); |
| 458 match.is_history_what_you_typed_match = false; | 458 match.is_history_what_you_typed_match = false; |
| 459 match.allowed_to_be_default_match = true; |
| 459 | 460 |
| 460 // The placeholder suggestion for the current URL has high relevance so | 461 // The placeholder suggestion for the current URL has high relevance so |
| 461 // that it is in the first suggestion slot and inline autocompleted. It | 462 // that it is in the first suggestion slot and inline autocompleted. It |
| 462 // gets dropped as soon as the user types something. | 463 // gets dropped as soon as the user types something. |
| 463 match.relevance = verbatim_relevance_; | 464 match.relevance = verbatim_relevance_; |
| 464 | 465 |
| 465 return match; | 466 return match; |
| 466 } | 467 } |
| OLD | NEW |