| 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 <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // policies), cached locally and installed from the | 45 // policies), cached locally and installed from the |
| 46 // cache. | 46 // cache. |
| 47 EXTERNAL_COMPONENT, // Similar to COMPONENT in that it's considered an | 47 EXTERNAL_COMPONENT, // Similar to COMPONENT in that it's considered an |
| 48 // internal implementation detail of chrome, but | 48 // internal implementation detail of chrome, but |
| 49 // installed from an update URL like the *DOWNLOAD ones. | 49 // installed from an update URL like the *DOWNLOAD ones. |
| 50 | 50 |
| 51 // New enum values must go above here. | 51 // New enum values must go above here. |
| 52 NUM_LOCATIONS | 52 NUM_LOCATIONS |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 // Do not change the order of entries or remove entries in this list | 55 // Do not change the order of entries or remove entries in this list as this |
| 56 // as this is used in UMA_HISTOGRAM_ENUMERATIONs about extensions. | 56 // is used in ExtensionType enum in tools/metrics/histograms/enums.xml. |
| 57 enum Type { | 57 enum Type { |
| 58 TYPE_UNKNOWN = 0, | 58 TYPE_UNKNOWN = 0, |
| 59 TYPE_EXTENSION, | 59 TYPE_EXTENSION = 1, |
| 60 TYPE_THEME, | 60 TYPE_THEME = 2, |
| 61 TYPE_USER_SCRIPT, | 61 TYPE_USER_SCRIPT = 3, |
| 62 TYPE_HOSTED_APP, | 62 TYPE_HOSTED_APP = 4, |
| 63 // This is marked legacy because platform apps are preferred. For | 63 // This is marked legacy because platform apps are preferred. For |
| 64 // backwards compatibility, we can't remove support for packaged apps | 64 // backwards compatibility, we can't remove support for packaged apps |
| 65 TYPE_LEGACY_PACKAGED_APP, | 65 TYPE_LEGACY_PACKAGED_APP = 5, |
| 66 TYPE_PLATFORM_APP, | 66 TYPE_PLATFORM_APP = 6, |
| 67 TYPE_SHARED_MODULE, | 67 TYPE_SHARED_MODULE = 7, |
| 68 | 68 |
| 69 // New enum values must go above here. | 69 // New enum values must go above here. |
| 70 NUM_LOAD_TYPES | 70 TYPE_MAX = TYPE_SHARED_MODULE, |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 // Given two install sources, return the one which should take priority | 73 // Given two install sources, return the one which should take priority |
| 74 // over the other. If an extension is installed from two sources A and B, | 74 // over the other. If an extension is installed from two sources A and B, |
| 75 // its install source should be set to GetHigherPriorityLocation(A, B). | 75 // its install source should be set to GetHigherPriorityLocation(A, B). |
| 76 static Location GetHigherPriorityLocation(Location loc1, Location loc2); | 76 static Location GetHigherPriorityLocation(Location loc1, Location loc2); |
| 77 | 77 |
| 78 // Whether the |location| is external or not. | 78 // Whether the |location| is external or not. |
| 79 static inline bool IsExternalLocation(Location location) { | 79 static inline bool IsExternalLocation(Location location) { |
| 80 return location == EXTERNAL_PREF || | 80 return location == EXTERNAL_PREF || |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 std::unique_ptr<base::DictionaryValue> value_; | 198 std::unique_ptr<base::DictionaryValue> value_; |
| 199 | 199 |
| 200 Type type_; | 200 Type type_; |
| 201 | 201 |
| 202 DISALLOW_COPY_AND_ASSIGN(Manifest); | 202 DISALLOW_COPY_AND_ASSIGN(Manifest); |
| 203 }; | 203 }; |
| 204 | 204 |
| 205 } // namespace extensions | 205 } // namespace extensions |
| 206 | 206 |
| 207 #endif // EXTENSIONS_COMMON_MANIFEST_H_ | 207 #endif // EXTENSIONS_COMMON_MANIFEST_H_ |
| OLD | NEW |