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 <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 | 150 |
151 // DEPRECATED: WAS_INSTALLED_BY_CUSTODIAN is now stored as a pref instead. | 151 // DEPRECATED: WAS_INSTALLED_BY_CUSTODIAN is now stored as a pref instead. |
152 // WAS_INSTALLED_BY_CUSTODIAN = 1 << 11, | 152 // WAS_INSTALLED_BY_CUSTODIAN = 1 << 11, |
153 | 153 |
154 // |MAY_BE_UNTRUSTED| indicates that this extension came from a potentially | 154 // |MAY_BE_UNTRUSTED| indicates that this extension came from a potentially |
155 // unsafe source (e.g., sideloaded from a local CRX file via the Windows | 155 // unsafe source (e.g., sideloaded from a local CRX file via the Windows |
156 // registry). Such extensions may be subjected to additional constraints | 156 // registry). Such extensions may be subjected to additional constraints |
157 // before they are fully installed and enabled. | 157 // before they are fully installed and enabled. |
158 MAY_BE_UNTRUSTED = 1 << 12, | 158 MAY_BE_UNTRUSTED = 1 << 12, |
159 | 159 |
160 // |RUN_ON_LOCK_SCREEN| indicates that this extension will be run on lock | |
161 // screen. It's primarily set for lock screen action handler platform apps. | |
162 // The apps will be able to create a window on top of Chrome OS lock screen | |
163 // and will have resticted access to extension APIs. The apps will be | |
164 // installed in a browser context not associated with any user. | |
165 RUNS_ON_LOCK_SCREEN = 1 << 13, | |
Devlin
2017/05/23 16:51:53
I'm not sure we want a creation flag for this, but
tbarzic
2017/05/23 17:30:23
I'll add code that uses the flag in later cls.
Th
Devlin
2017/05/25 20:42:02
Sorry for the delay.
I'd prefer we don't have thi
| |
166 | |
160 // When adding new flags, make sure to update kInitFromValueFlagBits. | 167 // When adding new flags, make sure to update kInitFromValueFlagBits. |
161 }; | 168 }; |
162 | 169 |
163 // This is the highest bit index of the flags defined above. | 170 // This is the highest bit index of the flags defined above. |
164 static const int kInitFromValueFlagBits; | 171 static const int kInitFromValueFlagBits; |
165 | 172 |
166 static scoped_refptr<Extension> Create(const base::FilePath& path, | 173 static scoped_refptr<Extension> Create(const base::FilePath& path, |
167 Manifest::Location location, | 174 Manifest::Location location, |
168 const base::DictionaryValue& value, | 175 const base::DictionaryValue& value, |
169 int flags, | 176 int flags, |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 bool may_be_untrusted() const { | 324 bool may_be_untrusted() const { |
318 return (creation_flags_ & MAY_BE_UNTRUSTED) != 0; | 325 return (creation_flags_ & MAY_BE_UNTRUSTED) != 0; |
319 } | 326 } |
320 bool was_installed_by_default() const { | 327 bool was_installed_by_default() const { |
321 return (creation_flags_ & WAS_INSTALLED_BY_DEFAULT) != 0; | 328 return (creation_flags_ & WAS_INSTALLED_BY_DEFAULT) != 0; |
322 } | 329 } |
323 bool was_installed_by_oem() const { | 330 bool was_installed_by_oem() const { |
324 return (creation_flags_ & WAS_INSTALLED_BY_OEM) != 0; | 331 return (creation_flags_ & WAS_INSTALLED_BY_OEM) != 0; |
325 } | 332 } |
326 | 333 |
334 bool runs_on_lock_screen() const { | |
335 return (creation_flags_ & RUNS_ON_LOCK_SCREEN) != 0; | |
336 } | |
337 | |
327 // Type-related queries. These are all mutually exclusive. | 338 // Type-related queries. These are all mutually exclusive. |
328 // | 339 // |
329 // The differences between the types of Extension are documented here: | 340 // The differences between the types of Extension are documented here: |
330 // https://chromium.googlesource.com/chromium/src/+/HEAD/extensions/docs/exten sion_and_app_types.md | 341 // https://chromium.googlesource.com/chromium/src/+/HEAD/extensions/docs/exten sion_and_app_types.md |
331 bool is_platform_app() const; // aka "V2 app", "V2 packaged app" | 342 bool is_platform_app() const; // aka "V2 app", "V2 packaged app" |
332 bool is_hosted_app() const; // Hosted app (or bookmark app) | 343 bool is_hosted_app() const; // Hosted app (or bookmark app) |
333 bool is_legacy_packaged_app() const; // aka "V1 packaged app" | 344 bool is_legacy_packaged_app() const; // aka "V1 packaged app" |
334 bool is_extension() const; // Regular browser extension, not an app | 345 bool is_extension() const; // Regular browser extension, not an app |
335 bool is_shared_module() const; // Shared module | 346 bool is_shared_module() const; // Shared module |
336 bool is_theme() const; // Theme | 347 bool is_theme() const; // Theme |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
552 const PermissionSet& permissions; | 563 const PermissionSet& permissions; |
553 | 564 |
554 UpdatedExtensionPermissionsInfo(const Extension* extension, | 565 UpdatedExtensionPermissionsInfo(const Extension* extension, |
555 const PermissionSet& permissions, | 566 const PermissionSet& permissions, |
556 Reason reason); | 567 Reason reason); |
557 }; | 568 }; |
558 | 569 |
559 } // namespace extensions | 570 } // namespace extensions |
560 | 571 |
561 #endif // EXTENSIONS_COMMON_EXTENSION_H_ | 572 #endif // EXTENSIONS_COMMON_EXTENSION_H_ |
OLD | NEW |