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