| 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/builtin_provider.h" | 5 #include "chrome/browser/autocomplete/builtin_provider.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete_input.h" | 9 #include "chrome/browser/autocomplete/autocomplete_input.h" |
| 10 #include "chrome/browser/browser_about_handler.h" | 10 #include "chrome/browser/browser_about_handler.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 chrome::kInternetOptionsSubPage, | 29 chrome::kInternetOptionsSubPage, |
| 30 #endif | 30 #endif |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 } // namespace | 33 } // namespace |
| 34 | 34 |
| 35 const int BuiltinProvider::kRelevance = 575; | 35 const int BuiltinProvider::kRelevance = 575; |
| 36 | 36 |
| 37 BuiltinProvider::BuiltinProvider(AutocompleteProviderListener* listener, | 37 BuiltinProvider::BuiltinProvider(AutocompleteProviderListener* listener, |
| 38 Profile* profile) | 38 Profile* profile) |
| 39 : AutocompleteProvider(listener, profile, "Builtin") { | 39 : AutocompleteProvider(listener, |
| 40 profile, |
| 41 AutocompleteProvider::TYPE_BUILTIN) { |
| 40 std::vector<std::string> builtins(ChromePaths()); | 42 std::vector<std::string> builtins(ChromePaths()); |
| 41 for (std::vector<std::string>::iterator i(builtins.begin()); | 43 for (std::vector<std::string>::iterator i(builtins.begin()); |
| 42 i != builtins.end(); ++i) | 44 i != builtins.end(); ++i) |
| 43 builtins_.push_back(ASCIIToUTF16(*i)); | 45 builtins_.push_back(ASCIIToUTF16(*i)); |
| 44 string16 settings(ASCIIToUTF16(chrome::kChromeUISettingsHost) + | 46 string16 settings(ASCIIToUTF16(chrome::kChromeUISettingsHost) + |
| 45 ASCIIToUTF16("/")); | 47 ASCIIToUTF16("/")); |
| 46 for (size_t i = 0; i < arraysize(kChromeSettingsSubPages); i++) | 48 for (size_t i = 0; i < arraysize(kChromeSettingsSubPages); i++) |
| 47 builtins_.push_back(settings + ASCIIToUTF16(kChromeSettingsSubPages[i])); | 49 builtins_.push_back(settings + ASCIIToUTF16(kChromeSettingsSubPages[i])); |
| 48 } | 50 } |
| 49 | 51 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 void BuiltinProvider::AddMatch(const string16& match_string, | 114 void BuiltinProvider::AddMatch(const string16& match_string, |
| 113 const ACMatchClassifications& styles) { | 115 const ACMatchClassifications& styles) { |
| 114 AutocompleteMatch match(this, kRelevance, false, | 116 AutocompleteMatch match(this, kRelevance, false, |
| 115 AutocompleteMatch::NAVSUGGEST); | 117 AutocompleteMatch::NAVSUGGEST); |
| 116 match.fill_into_edit = match_string; | 118 match.fill_into_edit = match_string; |
| 117 match.destination_url = GURL(match_string); | 119 match.destination_url = GURL(match_string); |
| 118 match.contents = match_string; | 120 match.contents = match_string; |
| 119 match.contents_class = styles; | 121 match.contents_class = styles; |
| 120 matches_.push_back(match); | 122 matches_.push_back(match); |
| 121 } | 123 } |
| OLD | NEW |