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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
507 // The name of the extension prior to this update. Will be empty if | 507 // The name of the extension prior to this update. Will be empty if |
508 // |is_update| is false. | 508 // |is_update| is false. |
509 std::string old_name; | 509 std::string old_name; |
510 | 510 |
511 InstalledExtensionInfo(const Extension* extension, | 511 InstalledExtensionInfo(const Extension* extension, |
512 bool is_update, | 512 bool is_update, |
513 bool from_ephemeral, | 513 bool from_ephemeral, |
514 const std::string& old_name); | 514 const std::string& old_name); |
515 }; | 515 }; |
516 | 516 |
517 struct UnloadedExtensionInfo { | 517 // TODO(DHNishi): Move this enum to ExtensionRegistryObserver. |
518 // TODO(DHNishi): Move this enum to ExtensionRegistryObserver. | 518 enum UnloadedExtensionReason { |
Devlin
2017/05/01 14:08:57
We should make this an enum class; otherwise the v
limasdf
2017/05/02 07:52:52
Yeah, we should. (sorry I didn't catch that)
I'll
| |
519 enum Reason { | 519 REASON_UNDEFINED, // Undefined state used to initialize variables. |
520 REASON_UNDEFINED, // Undefined state used to initialize variables. | 520 REASON_DISABLE, // Extension is being disabled. |
521 REASON_DISABLE, // Extension is being disabled. | 521 REASON_UPDATE, // Extension is being updated to a newer version. |
522 REASON_UPDATE, // Extension is being updated to a newer version. | 522 REASON_UNINSTALL, // Extension is being uninstalled. |
523 REASON_UNINSTALL, // Extension is being uninstalled. | 523 REASON_TERMINATE, // Extension has terminated. |
524 REASON_TERMINATE, // Extension has terminated. | 524 REASON_BLACKLIST, // Extension has been blacklisted. |
525 REASON_BLACKLIST, // Extension has been blacklisted. | 525 REASON_PROFILE_SHUTDOWN, // Profile is being shut down. |
526 REASON_PROFILE_SHUTDOWN, // Profile is being shut down. | 526 REASON_LOCK_ALL, // All extensions for the profile are blocked. |
527 REASON_LOCK_ALL, // All extensions for the profile are blocked. | 527 REASON_MIGRATED_TO_COMPONENT, // Extension is being migrated to a component |
528 REASON_MIGRATED_TO_COMPONENT, // Extension is being migrated to a component | 528 // action. |
529 // action. | |
530 }; | |
531 | |
532 Reason reason; | |
533 | |
534 // The extension being unloaded - this should always be non-NULL. | |
535 const Extension* extension; | |
536 | |
537 UnloadedExtensionInfo(const Extension* extension, Reason reason); | |
538 }; | 529 }; |
539 | 530 |
540 // The details sent for EXTENSION_PERMISSIONS_UPDATED notifications. | 531 // The details sent for EXTENSION_PERMISSIONS_UPDATED notifications. |
541 struct UpdatedExtensionPermissionsInfo { | 532 struct UpdatedExtensionPermissionsInfo { |
542 enum Reason { | 533 enum Reason { |
543 ADDED, // The permissions were added to the extension. | 534 ADDED, // The permissions were added to the extension. |
544 REMOVED, // The permissions were removed from the extension. | 535 REMOVED, // The permissions were removed from the extension. |
545 POLICY, // The policy that affects permissions was updated. | 536 POLICY, // The policy that affects permissions was updated. |
546 }; | 537 }; |
547 | 538 |
548 Reason reason; | 539 Reason reason; |
549 | 540 |
550 // The extension who's permissions have changed. | 541 // The extension who's permissions have changed. |
551 const Extension* extension; | 542 const Extension* extension; |
552 | 543 |
553 // The permissions that have changed. For Reason::ADDED, this would contain | 544 // The permissions that have changed. For Reason::ADDED, this would contain |
554 // only the permissions that have added, and for Reason::REMOVED, this would | 545 // only the permissions that have added, and for Reason::REMOVED, this would |
555 // only contain the removed permissions. | 546 // only contain the removed permissions. |
556 const PermissionSet& permissions; | 547 const PermissionSet& permissions; |
557 | 548 |
558 UpdatedExtensionPermissionsInfo(const Extension* extension, | 549 UpdatedExtensionPermissionsInfo(const Extension* extension, |
559 const PermissionSet& permissions, | 550 const PermissionSet& permissions, |
560 Reason reason); | 551 Reason reason); |
561 }; | 552 }; |
562 | 553 |
563 } // namespace extensions | 554 } // namespace extensions |
564 | 555 |
565 #endif // EXTENSIONS_COMMON_EXTENSION_H_ | 556 #endif // EXTENSIONS_COMMON_EXTENSION_H_ |
OLD | NEW |