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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 REQUIRE_PERMISSIONS_CONSENT = 1 << 8, | 163 REQUIRE_PERMISSIONS_CONSENT = 1 << 8, |
164 | 164 |
165 // Unused - this flag has been moved to ExtensionPrefs. | 165 // Unused - this flag has been moved to ExtensionPrefs. |
166 IS_EPHEMERAL = 1 << 9, | 166 IS_EPHEMERAL = 1 << 9, |
167 | 167 |
168 // |WAS_INSTALLED_BY_OEM| installed by an OEM (e.g on Chrome OS) and should | 168 // |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 | 169 // 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). | 170 // also installed by Default (i.e. WAS_INSTALLED_BY_DEFAULT is also true). |
171 WAS_INSTALLED_BY_OEM = 1 << 10, | 171 WAS_INSTALLED_BY_OEM = 1 << 10, |
172 | 172 |
| 173 // |WAS_INSTALLED_BY_CUSTODIAN| means this extension was installed by the |
| 174 // custodian of a supervised user. |
| 175 WAS_INSTALLED_BY_CUSTODIAN = 1 << 11, |
| 176 |
173 // When adding new flags, make sure to update kInitFromValueFlagBits. | 177 // When adding new flags, make sure to update kInitFromValueFlagBits. |
174 }; | 178 }; |
175 | 179 |
176 // This is the highest bit index of the flags defined above. | 180 // This is the highest bit index of the flags defined above. |
177 static const int kInitFromValueFlagBits; | 181 static const int kInitFromValueFlagBits; |
178 | 182 |
179 static scoped_refptr<Extension> Create(const base::FilePath& path, | 183 static scoped_refptr<Extension> Create(const base::FilePath& path, |
180 Manifest::Location location, | 184 Manifest::Location location, |
181 const base::DictionaryValue& value, | 185 const base::DictionaryValue& value, |
182 int flags, | 186 int flags, |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 331 } |
328 int creation_flags() const { return creation_flags_; } | 332 int creation_flags() const { return creation_flags_; } |
329 bool from_webstore() const { return (creation_flags_ & FROM_WEBSTORE) != 0; } | 333 bool from_webstore() const { return (creation_flags_ & FROM_WEBSTORE) != 0; } |
330 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; } | 334 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; } |
331 bool was_installed_by_default() const { | 335 bool was_installed_by_default() const { |
332 return (creation_flags_ & WAS_INSTALLED_BY_DEFAULT) != 0; | 336 return (creation_flags_ & WAS_INSTALLED_BY_DEFAULT) != 0; |
333 } | 337 } |
334 bool was_installed_by_oem() const { | 338 bool was_installed_by_oem() const { |
335 return (creation_flags_ & WAS_INSTALLED_BY_OEM) != 0; | 339 return (creation_flags_ & WAS_INSTALLED_BY_OEM) != 0; |
336 } | 340 } |
| 341 bool was_installed_by_custodian() const { |
| 342 return (creation_flags_ & WAS_INSTALLED_BY_CUSTODIAN) != 0; |
| 343 } |
337 | 344 |
338 // App-related. | 345 // App-related. |
339 bool is_app() const; | 346 bool is_app() const; |
340 bool is_platform_app() const; | 347 bool is_platform_app() const; |
341 bool is_hosted_app() const; | 348 bool is_hosted_app() const; |
342 bool is_legacy_packaged_app() const; | 349 bool is_legacy_packaged_app() const; |
343 bool is_extension() const; | 350 bool is_extension() const; |
344 bool can_be_incognito_enabled() const; | 351 bool can_be_incognito_enabled() const; |
345 | 352 |
346 void AddWebExtentPattern(const URLPattern& pattern); | 353 void AddWebExtentPattern(const URLPattern& pattern); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 | 569 |
563 UpdatedExtensionPermissionsInfo( | 570 UpdatedExtensionPermissionsInfo( |
564 const Extension* extension, | 571 const Extension* extension, |
565 const PermissionSet* permissions, | 572 const PermissionSet* permissions, |
566 Reason reason); | 573 Reason reason); |
567 }; | 574 }; |
568 | 575 |
569 } // namespace extensions | 576 } // namespace extensions |
570 | 577 |
571 #endif // EXTENSIONS_COMMON_EXTENSION_H_ | 578 #endif // EXTENSIONS_COMMON_EXTENSION_H_ |
OLD | NEW |