OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_COMMON_MANIFEST_H_ | 5 #ifndef EXTENSIONS_COMMON_MANIFEST_H_ |
6 #define EXTENSIONS_COMMON_MANIFEST_H_ | 6 #define EXTENSIONS_COMMON_MANIFEST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 21 matching lines...) Expand all Loading... |
32 // registry on Windows). | 32 // registry on Windows). |
33 UNPACKED, // From loading an unpacked extension from the | 33 UNPACKED, // From loading an unpacked extension from the |
34 // extensions settings page. | 34 // extensions settings page. |
35 COMPONENT, // An integral component of Chrome itself, which | 35 COMPONENT, // An integral component of Chrome itself, which |
36 // happens to be implemented as an extension. We don't | 36 // happens to be implemented as an extension. We don't |
37 // show these in the management UI. | 37 // show these in the management UI. |
38 EXTERNAL_PREF_DOWNLOAD, // A crx file from an external directory (via | 38 EXTERNAL_PREF_DOWNLOAD, // A crx file from an external directory (via |
39 // prefs), installed from an update URL. | 39 // prefs), installed from an update URL. |
40 EXTERNAL_POLICY_DOWNLOAD, // A crx file from an external directory (via | 40 EXTERNAL_POLICY_DOWNLOAD, // A crx file from an external directory (via |
41 // admin policies), installed from an update URL. | 41 // admin policies), installed from an update URL. |
42 COMMAND_LINE, // --load-extension. | 42 COMMAND_LINE, // --load-extension. |
43 EXTERNAL_POLICY, // A crx file from an external directory (via admin | 43 EXTERNAL_POLICY, // A crx file from an external directory (via admin |
44 // policies), cached locally and installed from the | 44 // policies), cached locally and installed from the |
45 // cache. | 45 // cache. |
46 EXTERNAL_COMPONENT, // Similar to COMPONENT in that it's considered an | 46 EXTERNAL_COMPONENT, // Similar to COMPONENT in that it's considered an |
47 // internal implementation detail of chrome, but | 47 // internal implementation detail of chrome, but |
48 // installed from an update URL like the *DOWNLOAD ones. | 48 // installed from an update URL like the *DOWNLOAD ones. |
49 | 49 |
| 50 // New enum values must go above here. |
50 NUM_LOCATIONS | 51 NUM_LOCATIONS |
51 }; | 52 }; |
52 | 53 |
53 // Do not change the order of entries or remove entries in this list | 54 // Do not change the order of entries or remove entries in this list |
54 // as this is used in UMA_HISTOGRAM_ENUMERATIONs about extensions. | 55 // as this is used in UMA_HISTOGRAM_ENUMERATIONs about extensions. |
55 enum Type { | 56 enum Type { |
56 TYPE_UNKNOWN = 0, | 57 TYPE_UNKNOWN = 0, |
57 TYPE_EXTENSION, | 58 TYPE_EXTENSION, |
58 TYPE_THEME, | 59 TYPE_THEME, |
59 TYPE_USER_SCRIPT, | 60 TYPE_USER_SCRIPT, |
60 TYPE_HOSTED_APP, | 61 TYPE_HOSTED_APP, |
61 // This is marked legacy because platform apps are preferred. For | 62 // This is marked legacy because platform apps are preferred. For |
62 // backwards compatibility, we can't remove support for packaged apps | 63 // backwards compatibility, we can't remove support for packaged apps |
63 TYPE_LEGACY_PACKAGED_APP, | 64 TYPE_LEGACY_PACKAGED_APP, |
64 TYPE_PLATFORM_APP, | 65 TYPE_PLATFORM_APP, |
65 TYPE_SHARED_MODULE | 66 TYPE_SHARED_MODULE, |
| 67 |
| 68 // New enum values must go above here. |
| 69 NUM_LOAD_TYPES |
66 }; | 70 }; |
67 | 71 |
68 // Given two install sources, return the one which should take priority | 72 // Given two install sources, return the one which should take priority |
69 // over the other. If an extension is installed from two sources A and B, | 73 // over the other. If an extension is installed from two sources A and B, |
70 // its install source should be set to GetHigherPriorityLocation(A, B). | 74 // its install source should be set to GetHigherPriorityLocation(A, B). |
71 static Location GetHigherPriorityLocation(Location loc1, Location loc2); | 75 static Location GetHigherPriorityLocation(Location loc1, Location loc2); |
72 | 76 |
73 // Whether the |location| is external or not. | 77 // Whether the |location| is external or not. |
74 static inline bool IsExternalLocation(Location location) { | 78 static inline bool IsExternalLocation(Location location) { |
75 return location == EXTERNAL_PREF || | 79 return location == EXTERNAL_PREF || |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 scoped_ptr<base::DictionaryValue> value_; | 193 scoped_ptr<base::DictionaryValue> value_; |
190 | 194 |
191 Type type_; | 195 Type type_; |
192 | 196 |
193 DISALLOW_COPY_AND_ASSIGN(Manifest); | 197 DISALLOW_COPY_AND_ASSIGN(Manifest); |
194 }; | 198 }; |
195 | 199 |
196 } // namespace extensions | 200 } // namespace extensions |
197 | 201 |
198 #endif // EXTENSIONS_COMMON_MANIFEST_H_ | 202 #endif // EXTENSIONS_COMMON_MANIFEST_H_ |
OLD | NEW |