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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 class Extension : public base::RefCountedThreadSafe<Extension> { | 56 class Extension : public base::RefCountedThreadSafe<Extension> { |
57 public: | 57 public: |
58 struct ManifestData; | 58 struct ManifestData; |
59 | 59 |
60 typedef std::map<const std::string, linked_ptr<ManifestData> > | 60 typedef std::map<const std::string, linked_ptr<ManifestData> > |
61 ManifestDataMap; | 61 ManifestDataMap; |
62 | 62 |
63 enum State { | 63 enum State { |
64 DISABLED = 0, | 64 DISABLED = 0, |
65 ENABLED, | 65 ENABLED, |
66 LOCKED, | |
66 // An external extension that the user uninstalled. We should not reinstall | 67 // An external extension that the user uninstalled. We should not reinstall |
67 // such extensions on startup. | 68 // such extensions on startup. |
68 EXTERNAL_EXTENSION_UNINSTALLED, | 69 EXTERNAL_EXTENSION_UNINSTALLED, |
69 // DEPRECATED: Special state for component extensions. | 70 // DEPRECATED: Special state for component extensions. |
70 // Maintained as a placeholder since states may be stored to disk. | 71 // Maintained as a placeholder since states may be stored to disk. |
71 ENABLED_COMPONENT_DEPRECATED, | 72 ENABLED_COMPONENT_DEPRECATED, |
72 NUM_STATES | 73 NUM_STATES |
73 }; | 74 }; |
74 | 75 |
75 // Used to record the reason an extension was disabled. | 76 // Used to record the reason an extension was disabled. |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
532 struct UnloadedExtensionInfo { | 533 struct UnloadedExtensionInfo { |
533 // TODO(DHNishi): Move this enum to ExtensionRegistryObserver. | 534 // TODO(DHNishi): Move this enum to ExtensionRegistryObserver. |
534 enum Reason { | 535 enum Reason { |
535 REASON_UNDEFINED, // Undefined state used to initialize variables. | 536 REASON_UNDEFINED, // Undefined state used to initialize variables. |
536 REASON_DISABLE, // Extension is being disabled. | 537 REASON_DISABLE, // Extension is being disabled. |
537 REASON_UPDATE, // Extension is being updated to a newer version. | 538 REASON_UPDATE, // Extension is being updated to a newer version. |
538 REASON_UNINSTALL, // Extension is being uninstalled. | 539 REASON_UNINSTALL, // Extension is being uninstalled. |
539 REASON_TERMINATE, // Extension has terminated. | 540 REASON_TERMINATE, // Extension has terminated. |
540 REASON_BLACKLIST, // Extension has been blacklisted. | 541 REASON_BLACKLIST, // Extension has been blacklisted. |
541 REASON_PROFILE_SHUTDOWN, // Profile is being shut down. | 542 REASON_PROFILE_SHUTDOWN, // Profile is being shut down. |
543 REASON_PROFILE_LOCK, // Profile is being locked. | |
noms (inactive)
2014/11/12 19:23:51
nit: is being locked or has already been locked?
Mike Lerman
2014/11/12 20:58:42
Re-written.
| |
542 }; | 544 }; |
543 | 545 |
544 Reason reason; | 546 Reason reason; |
545 | 547 |
546 // The extension being unloaded - this should always be non-NULL. | 548 // The extension being unloaded - this should always be non-NULL. |
547 const Extension* extension; | 549 const Extension* extension; |
548 | 550 |
549 UnloadedExtensionInfo(const Extension* extension, Reason reason); | 551 UnloadedExtensionInfo(const Extension* extension, Reason reason); |
550 }; | 552 }; |
551 | 553 |
(...skipping 16 matching lines...) Expand all Loading... | |
568 | 570 |
569 UpdatedExtensionPermissionsInfo( | 571 UpdatedExtensionPermissionsInfo( |
570 const Extension* extension, | 572 const Extension* extension, |
571 const PermissionSet* permissions, | 573 const PermissionSet* permissions, |
572 Reason reason); | 574 Reason reason); |
573 }; | 575 }; |
574 | 576 |
575 } // namespace extensions | 577 } // namespace extensions |
576 | 578 |
577 #endif // EXTENSIONS_COMMON_EXTENSION_H_ | 579 #endif // EXTENSIONS_COMMON_EXTENSION_H_ |
OLD | NEW |