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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_EXTENSION_APP_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_EXTENSION_APP_PROVIDER_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_EXTENSION_APP_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_EXTENSION_APP_PROVIDER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 WindowOpenDisposition disposition); | 39 WindowOpenDisposition disposition); |
40 | 40 |
41 private: | 41 private: |
42 friend class ExtensionAppProviderTest; | 42 friend class ExtensionAppProviderTest; |
43 FRIEND_TEST_ALL_PREFIXES(ExtensionAppProviderTest, CreateMatchSanitize); | 43 FRIEND_TEST_ALL_PREFIXES(ExtensionAppProviderTest, CreateMatchSanitize); |
44 | 44 |
45 // ExtensionApp stores the minimal metadata that we need to match against | 45 // ExtensionApp stores the minimal metadata that we need to match against |
46 // eligible apps. | 46 // eligible apps. |
47 struct ExtensionApp { | 47 struct ExtensionApp { |
48 // App's name. | 48 // App's name. |
49 string16 name; | 49 base::string16 name; |
50 // App's launch URL (for platform apps, which don't have a launch URL, this | 50 // App's launch URL (for platform apps, which don't have a launch URL, this |
51 // just points to the app's origin). | 51 // just points to the app's origin). |
52 string16 launch_url; | 52 base::string16 launch_url; |
53 // If false, then the launch_url will not be considered for matching, | 53 // If false, then the launch_url will not be considered for matching, |
54 // not shown next to the match, and not displayed as the editable text if | 54 // not shown next to the match, and not displayed as the editable text if |
55 // the user selects the match with the arrow keys. | 55 // the user selects the match with the arrow keys. |
56 bool should_match_against_launch_url; | 56 bool should_match_against_launch_url; |
57 }; | 57 }; |
58 typedef std::vector<ExtensionApp> ExtensionApps; | 58 typedef std::vector<ExtensionApp> ExtensionApps; |
59 | 59 |
60 virtual ~ExtensionAppProvider(); | 60 virtual ~ExtensionAppProvider(); |
61 | 61 |
62 void AddExtensionAppForTesting(const ExtensionApp& extension_app); | 62 void AddExtensionAppForTesting(const ExtensionApp& extension_app); |
(...skipping 21 matching lines...) Expand all Loading... |
84 content::NotificationRegistrar registrar_; | 84 content::NotificationRegistrar registrar_; |
85 | 85 |
86 // Our cache of ExtensionApp objects (name + url) representing the extension | 86 // Our cache of ExtensionApp objects (name + url) representing the extension |
87 // apps we know/care about. | 87 // apps we know/care about. |
88 ExtensionApps extension_apps_; | 88 ExtensionApps extension_apps_; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(ExtensionAppProvider); | 90 DISALLOW_COPY_AND_ASSIGN(ExtensionAppProvider); |
91 }; | 91 }; |
92 | 92 |
93 #endif // CHROME_BROWSER_AUTOCOMPLETE_EXTENSION_APP_PROVIDER_H_ | 93 #endif // CHROME_BROWSER_AUTOCOMPLETE_EXTENSION_APP_PROVIDER_H_ |
OLD | NEW |