| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/history_url_provider.h" | 5 #include "chrome/browser/autocomplete/history_url_provider.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 if (!match.url_info.typed_count() || | 418 if (!match.url_info.typed_count() || |
| 419 ((match.url_info.typed_count() == 1) && | 419 ((match.url_info.typed_count() == 1) && |
| 420 !history::IsHostOnly(match.url_info.url()))) | 420 !history::IsHostOnly(match.url_info.url()))) |
| 421 return false; | 421 return false; |
| 422 | 422 |
| 423 params->matches.push_back(HistoryMatchToACMatch(params, match, | 423 params->matches.push_back(HistoryMatchToACMatch(params, match, |
| 424 INLINE_AUTOCOMPLETE, 0)); | 424 INLINE_AUTOCOMPLETE, 0)); |
| 425 return true; | 425 return true; |
| 426 } | 426 } |
| 427 | 427 |
| 428 HistoryURLProvider::~HistoryURLProvider() {} |
| 429 |
| 428 // static | 430 // static |
| 429 history::Prefixes HistoryURLProvider::GetPrefixes() { | 431 history::Prefixes HistoryURLProvider::GetPrefixes() { |
| 430 // We'll complete text following these prefixes. | 432 // We'll complete text following these prefixes. |
| 431 // NOTE: There's no requirement that these be in any particular order. | 433 // NOTE: There's no requirement that these be in any particular order. |
| 432 Prefixes prefixes; | 434 Prefixes prefixes; |
| 433 prefixes.push_back(Prefix(ASCIIToUTF16("https://www."), 2)); | 435 prefixes.push_back(Prefix(ASCIIToUTF16("https://www."), 2)); |
| 434 prefixes.push_back(Prefix(ASCIIToUTF16("http://www."), 2)); | 436 prefixes.push_back(Prefix(ASCIIToUTF16("http://www."), 2)); |
| 435 prefixes.push_back(Prefix(ASCIIToUTF16("ftp://ftp."), 2)); | 437 prefixes.push_back(Prefix(ASCIIToUTF16("ftp://ftp."), 2)); |
| 436 prefixes.push_back(Prefix(ASCIIToUTF16("ftp://www."), 2)); | 438 prefixes.push_back(Prefix(ASCIIToUTF16("ftp://www."), 2)); |
| 437 prefixes.push_back(Prefix(ASCIIToUTF16("https://"), 1)); | 439 prefixes.push_back(Prefix(ASCIIToUTF16("https://"), 1)); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 &match.contents_class); | 805 &match.contents_class); |
| 804 } | 806 } |
| 805 match.description = info.title(); | 807 match.description = info.title(); |
| 806 AutocompleteMatch::ClassifyMatchInString(params->input.text(), | 808 AutocompleteMatch::ClassifyMatchInString(params->input.text(), |
| 807 info.title(), | 809 info.title(), |
| 808 ACMatchClassification::NONE, | 810 ACMatchClassification::NONE, |
| 809 &match.description_class); | 811 &match.description_class); |
| 810 | 812 |
| 811 return match; | 813 return match; |
| 812 } | 814 } |
| OLD | NEW |