| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_EXTENSION_H_ | 5 #ifndef EXTENSIONS_COMMON_EXTENSION_H_ |
| 6 #define EXTENSIONS_COMMON_EXTENSION_H_ | 6 #define EXTENSIONS_COMMON_EXTENSION_H_ |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <iosfwd> | 9 #include <iosfwd> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 NEW_INSTALL | 110 NEW_INSTALL |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 // A base class for parsed manifest data that APIs want to store on | 113 // A base class for parsed manifest data that APIs want to store on |
| 114 // the extension. Related to base::SupportsUserData, but with an immutable | 114 // the extension. Related to base::SupportsUserData, but with an immutable |
| 115 // thread-safe interface to match Extension. | 115 // thread-safe interface to match Extension. |
| 116 struct ManifestData { | 116 struct ManifestData { |
| 117 virtual ~ManifestData() {} | 117 virtual ~ManifestData() {} |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 // Do not change the order of entries or remove entries in this list |
| 121 // as this is used in UMA_HISTOGRAM_ENUMERATIONs about extensions. |
| 120 enum InitFromValueFlags { | 122 enum InitFromValueFlags { |
| 121 NO_FLAGS = 0, | 123 NO_FLAGS = 0, |
| 122 | 124 |
| 123 // Usually, the id of an extension is generated by the "key" property of | 125 // Usually, the id of an extension is generated by the "key" property of |
| 124 // its manifest, but if |REQUIRE_KEY| is not set, a temporary ID will be | 126 // its manifest, but if |REQUIRE_KEY| is not set, a temporary ID will be |
| 125 // generated based on the path. | 127 // generated based on the path. |
| 126 REQUIRE_KEY = 1 << 0, | 128 REQUIRE_KEY = 1 << 0, |
| 127 | 129 |
| 128 // Requires the extension to have an up-to-date manifest version. | 130 // Requires the extension to have an up-to-date manifest version. |
| 129 // Typically, we'll support multiple manifest versions during a version | 131 // Typically, we'll support multiple manifest versions during a version |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 REQUIRE_PERMISSIONS_CONSENT = 1 << 8, | 164 REQUIRE_PERMISSIONS_CONSENT = 1 << 8, |
| 163 | 165 |
| 164 // |IS_EPHEMERAL| identifies ephemeral apps (experimental), which are not | 166 // |IS_EPHEMERAL| identifies ephemeral apps (experimental), which are not |
| 165 // permanently installed. | 167 // permanently installed. |
| 166 IS_EPHEMERAL = 1 << 9, | 168 IS_EPHEMERAL = 1 << 9, |
| 167 | 169 |
| 168 // |WAS_INSTALLED_BY_OEM| installed by an OEM (e.g on Chrome OS) and should | 170 // |WAS_INSTALLED_BY_OEM| installed by an OEM (e.g on Chrome OS) and should |
| 169 // be placed in a special OEM folder in the App Launcher. Note: OEM apps are | 171 // be placed in a special OEM folder in the App Launcher. Note: OEM apps are |
| 170 // also installed by Default (i.e. WAS_INSTALLED_BY_DEFAULT is also true). | 172 // also installed by Default (i.e. WAS_INSTALLED_BY_DEFAULT is also true). |
| 171 WAS_INSTALLED_BY_OEM = 1 << 10, | 173 WAS_INSTALLED_BY_OEM = 1 << 10, |
| 174 LAST_INIT_FROM_VALUE_FLAGS = WAS_INSTALLED_BY_OEM, |
| 172 }; | 175 }; |
| 173 | 176 |
| 174 static scoped_refptr<Extension> Create(const base::FilePath& path, | 177 static scoped_refptr<Extension> Create(const base::FilePath& path, |
| 175 Manifest::Location location, | 178 Manifest::Location location, |
| 176 const base::DictionaryValue& value, | 179 const base::DictionaryValue& value, |
| 177 int flags, | 180 int flags, |
| 178 std::string* error); | 181 std::string* error); |
| 179 | 182 |
| 180 // In a few special circumstances, we want to create an Extension and give it | 183 // In a few special circumstances, we want to create an Extension and give it |
| 181 // an explicit id. Most consumers should just use the other Create() method. | 184 // an explicit id. Most consumers should just use the other Create() method. |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 | 549 |
| 547 UpdatedExtensionPermissionsInfo( | 550 UpdatedExtensionPermissionsInfo( |
| 548 const Extension* extension, | 551 const Extension* extension, |
| 549 const PermissionSet* permissions, | 552 const PermissionSet* permissions, |
| 550 Reason reason); | 553 Reason reason); |
| 551 }; | 554 }; |
| 552 | 555 |
| 553 } // namespace extensions | 556 } // namespace extensions |
| 554 | 557 |
| 555 #endif // EXTENSIONS_COMMON_EXTENSION_H_ | 558 #endif // EXTENSIONS_COMMON_EXTENSION_H_ |
| OLD | NEW |