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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 | 450 |
451 AutocompleteMatch ZeroSuggestProvider::MatchForCurrentURL() { | 451 AutocompleteMatch ZeroSuggestProvider::MatchForCurrentURL() { |
452 AutocompleteInput input(permanent_text_, string16::npos, | 452 AutocompleteInput input(permanent_text_, string16::npos, |
453 string16(), GURL(current_query_), | 453 string16(), GURL(current_query_), |
454 false, false, true, AutocompleteInput::ALL_MATCHES); | 454 false, false, true, AutocompleteInput::ALL_MATCHES); |
455 | 455 |
456 AutocompleteMatch match( | 456 AutocompleteMatch match( |
457 HistoryURLProvider::SuggestExactInput(this, input, | 457 HistoryURLProvider::SuggestExactInput(this, input, |
458 !HasHTTPScheme(input.text()))); | 458 !HasHTTPScheme(input.text()))); |
459 match.is_history_what_you_typed_match = false; | 459 match.is_history_what_you_typed_match = false; |
| 460 match.allowed_to_be_default_match = true; |
460 | 461 |
461 // The placeholder suggestion for the current URL has high relevance so | 462 // The placeholder suggestion for the current URL has high relevance so |
462 // that it is in the first suggestion slot and inline autocompleted. It | 463 // that it is in the first suggestion slot and inline autocompleted. It |
463 // gets dropped as soon as the user types something. | 464 // gets dropped as soon as the user types something. |
464 match.relevance = verbatim_relevance_; | 465 match.relevance = verbatim_relevance_; |
465 | 466 |
466 return match; | 467 return match; |
467 } | 468 } |
OLD | NEW |