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