Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: extensions/common/extension.h

Issue 2054773002: Replace the WAS_INSTALLED_BY_CUSTODIAN creation flag with a pref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reload if installed_by_custodian becomes false. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 REQUIRE_PERMISSIONS_CONSENT = 1 << 8, 145 REQUIRE_PERMISSIONS_CONSENT = 1 << 8,
146 146
147 // Unused - this flag has been moved to ExtensionPrefs. 147 // Unused - this flag has been moved to ExtensionPrefs.
148 IS_EPHEMERAL = 1 << 9, 148 IS_EPHEMERAL = 1 << 9,
149 149
150 // |WAS_INSTALLED_BY_OEM| installed by an OEM (e.g on Chrome OS) and should 150 // |WAS_INSTALLED_BY_OEM| installed by an OEM (e.g on Chrome OS) and should
151 // be placed in a special OEM folder in the App Launcher. Note: OEM apps are 151 // be placed in a special OEM folder in the App Launcher. Note: OEM apps are
152 // also installed by Default (i.e. WAS_INSTALLED_BY_DEFAULT is also true). 152 // also installed by Default (i.e. WAS_INSTALLED_BY_DEFAULT is also true).
153 WAS_INSTALLED_BY_OEM = 1 << 10, 153 WAS_INSTALLED_BY_OEM = 1 << 10,
154 154
155 // |WAS_INSTALLED_BY_CUSTODIAN| means this extension was installed by the 155 // DEPRECATED:: WAS_INSTALLED_BY_CUSTODIAN is now stored as a pref instead.
Marc Treib 2016/06/20 16:42:39 nit: double colon
mamir 2016/06/20 16:55:45 Done.
156 // custodian of a supervised user. 156 // WAS_INSTALLED_BY_CUSTODIAN = 1 << 11,
157 WAS_INSTALLED_BY_CUSTODIAN = 1 << 11,
158 157
159 // |MAY_BE_UNTRUSTED| indicates that this extension came from a potentially 158 // |MAY_BE_UNTRUSTED| indicates that this extension came from a potentially
160 // unsafe source (e.g., sideloaded from a local CRX file via the Windows 159 // unsafe source (e.g., sideloaded from a local CRX file via the Windows
161 // registry). Such extensions may be subjected to additional constraints 160 // registry). Such extensions may be subjected to additional constraints
162 // before they are fully installed and enabled. 161 // before they are fully installed and enabled.
163 MAY_BE_UNTRUSTED = 1 << 12, 162 MAY_BE_UNTRUSTED = 1 << 12,
164 163
165 // When adding new flags, make sure to update kInitFromValueFlagBits. 164 // When adding new flags, make sure to update kInitFromValueFlagBits.
166 }; 165 };
167 166
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; } 323 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; }
325 bool may_be_untrusted() const { 324 bool may_be_untrusted() const {
326 return (creation_flags_ & MAY_BE_UNTRUSTED) != 0; 325 return (creation_flags_ & MAY_BE_UNTRUSTED) != 0;
327 } 326 }
328 bool was_installed_by_default() const { 327 bool was_installed_by_default() const {
329 return (creation_flags_ & WAS_INSTALLED_BY_DEFAULT) != 0; 328 return (creation_flags_ & WAS_INSTALLED_BY_DEFAULT) != 0;
330 } 329 }
331 bool was_installed_by_oem() const { 330 bool was_installed_by_oem() const {
332 return (creation_flags_ & WAS_INSTALLED_BY_OEM) != 0; 331 return (creation_flags_ & WAS_INSTALLED_BY_OEM) != 0;
333 } 332 }
334 bool was_installed_by_custodian() const {
335 return (creation_flags_ & WAS_INSTALLED_BY_CUSTODIAN) != 0;
336 }
337 333
338 // Type-related queries. 334 // Type-related queries.
339 bool is_app() const; 335 bool is_app() const;
340 bool is_platform_app() const; 336 bool is_platform_app() const;
341 bool is_hosted_app() const; 337 bool is_hosted_app() const;
342 bool is_legacy_packaged_app() const; 338 bool is_legacy_packaged_app() const;
343 bool is_extension() const; 339 bool is_extension() const;
344 bool is_shared_module() const; 340 bool is_shared_module() const;
345 bool is_theme() const; 341 bool is_theme() const;
346 342
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 const PermissionSet& permissions; 562 const PermissionSet& permissions;
567 563
568 UpdatedExtensionPermissionsInfo(const Extension* extension, 564 UpdatedExtensionPermissionsInfo(const Extension* extension,
569 const PermissionSet& permissions, 565 const PermissionSet& permissions,
570 Reason reason); 566 Reason reason);
571 }; 567 };
572 568
573 } // namespace extensions 569 } // namespace extensions
574 570
575 #endif // EXTENSIONS_COMMON_EXTENSION_H_ 571 #endif // EXTENSIONS_COMMON_EXTENSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698