Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Side by Side Diff: chrome/browser/autocomplete/builtin_provider.cc

Issue 10909130: autocomplete: Add AutocompleteProvider::Type enum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add !! for windows Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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, profile,
40 AutocompleteProvider::TYPE_BUILTIN) {
40 std::vector<std::string> builtins(ChromePaths()); 41 std::vector<std::string> builtins(ChromePaths());
41 for (std::vector<std::string>::iterator i(builtins.begin()); 42 for (std::vector<std::string>::iterator i(builtins.begin());
42 i != builtins.end(); ++i) 43 i != builtins.end(); ++i)
43 builtins_.push_back(ASCIIToUTF16(*i)); 44 builtins_.push_back(ASCIIToUTF16(*i));
44 string16 settings(ASCIIToUTF16(chrome::kChromeUISettingsHost) + 45 string16 settings(ASCIIToUTF16(chrome::kChromeUISettingsHost) +
45 ASCIIToUTF16("/")); 46 ASCIIToUTF16("/"));
46 for (size_t i = 0; i < arraysize(kChromeSettingsSubPages); i++) 47 for (size_t i = 0; i < arraysize(kChromeSettingsSubPages); i++)
47 builtins_.push_back(settings + ASCIIToUTF16(kChromeSettingsSubPages[i])); 48 builtins_.push_back(settings + ASCIIToUTF16(kChromeSettingsSubPages[i]));
48 } 49 }
49 50
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 void BuiltinProvider::AddMatch(const string16& match_string, 113 void BuiltinProvider::AddMatch(const string16& match_string,
113 const ACMatchClassifications& styles) { 114 const ACMatchClassifications& styles) {
114 AutocompleteMatch match(this, kRelevance, false, 115 AutocompleteMatch match(this, kRelevance, false,
115 AutocompleteMatch::NAVSUGGEST); 116 AutocompleteMatch::NAVSUGGEST);
116 match.fill_into_edit = match_string; 117 match.fill_into_edit = match_string;
117 match.destination_url = GURL(match_string); 118 match.destination_url = GURL(match_string);
118 match.contents = match_string; 119 match.contents = match_string;
119 match.contents_class = styles; 120 match.contents_class = styles;
120 matches_.push_back(match); 121 matches_.push_back(match);
121 } 122 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_provider_unittest.cc ('k') | chrome/browser/autocomplete/extension_app_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698