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