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