OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file contains the autocomplete provider for built-in URLs, | 5 // This file contains the autocomplete provider for built-in URLs, |
6 // such as about:settings and chrome://version. | 6 // such as about:settings. |
7 // | 7 // |
8 // For more information on the autocomplete system in general, including how | 8 // For more information on the autocomplete system in general, including how |
9 // the autocomplete controller and autocomplete providers work, see | 9 // the autocomplete controller and autocomplete providers work, see |
10 // chrome/browser/autocomplete.h. | 10 // chrome/browser/autocomplete.h. |
11 | 11 |
12 #ifndef CHROME_BROWSER_AUTOCOMPLETE_BUILTIN_PROVIDER_H_ | 12 #ifndef CHROME_BROWSER_AUTOCOMPLETE_BUILTIN_PROVIDER_H_ |
13 #define CHROME_BROWSER_AUTOCOMPLETE_BUILTIN_PROVIDER_H_ | 13 #define CHROME_BROWSER_AUTOCOMPLETE_BUILTIN_PROVIDER_H_ |
14 #pragma once | 14 #pragma once |
15 | 15 |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "base/string16.h" | 18 #include "base/string16.h" |
19 #include "chrome/browser/autocomplete/autocomplete.h" | 19 #include "chrome/browser/autocomplete/autocomplete.h" |
20 #include "chrome/browser/autocomplete/autocomplete_match.h" | |
21 | 20 |
22 class BuiltinProvider : public AutocompleteProvider { | 21 class BuiltinProvider : public AutocompleteProvider { |
23 public: | 22 public: |
24 BuiltinProvider(ACProviderListener* listener, Profile* profile); | 23 BuiltinProvider(ACProviderListener* listener, Profile* profile); |
25 virtual ~BuiltinProvider(); | 24 virtual ~BuiltinProvider(); |
26 | 25 |
27 // AutocompleteProvider: | 26 // AutocompleteProvider: |
28 virtual void Start(const AutocompleteInput& input, bool minimal_changes); | 27 virtual void Start(const AutocompleteInput& input, bool minimal_changes); |
29 | 28 |
30 private: | 29 private: |
31 typedef std::vector<string16> Builtins; | |
32 | |
33 static const int kRelevance; | 30 static const int kRelevance; |
34 | 31 |
35 void AddMatch(const string16& match_string, | 32 typedef std::vector<string16> Builtins; |
36 const ACMatchClassifications& styles); | |
37 | 33 |
38 Builtins builtins_; | 34 Builtins builtins_; |
39 | 35 |
40 DISALLOW_IMPLICIT_CONSTRUCTORS(BuiltinProvider); | 36 DISALLOW_IMPLICIT_CONSTRUCTORS(BuiltinProvider); |
41 }; | 37 }; |
42 | 38 |
43 #endif // CHROME_BROWSER_AUTOCOMPLETE_BUILTIN_PROVIDER_H_ | 39 #endif // CHROME_BROWSER_AUTOCOMPLETE_BUILTIN_PROVIDER_H_ |
OLD | NEW |