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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 }; | 536 }; |
537 | 537 |
538 Reason reason; | 538 Reason reason; |
539 | 539 |
540 // The extension being unloaded - this should always be non-NULL. | 540 // The extension being unloaded - this should always be non-NULL. |
541 const Extension* extension; | 541 const Extension* extension; |
542 | 542 |
543 UnloadedExtensionInfo(const Extension* extension, Reason reason); | 543 UnloadedExtensionInfo(const Extension* extension, Reason reason); |
544 }; | 544 }; |
545 | 545 |
| 546 struct UninstalledExtensionInfo { |
| 547 enum Reason { |
| 548 REASON_FOR_TESTING, // Used for testing code only |
| 549 REASON_USER_INITIATED, // User performed some UI gesture |
| 550 REASON_EXTENSION_DISABLED, // Extension disabled due to error |
| 551 REASON_STORAGE_THRESHOLD_EXCEEDED, |
| 552 REASON_INSTALL_CANCELED, |
| 553 REASON_MANAGEMENT_API, |
| 554 REASON_SYNC, |
| 555 REASON_ORPHANED_THEME, |
| 556 REASON_ORPHANED_EPHEMERAL_EXTENSION, |
| 557 // The entries below imply bypassing checking user has permission to |
| 558 // uninstall the corresponding extension id. |
| 559 REASON_ORPHANED_EXTERNAL_EXTENSION, |
| 560 REASON_ORPHANED_SHARED_MODULE, |
| 561 REASON_INTERNAL_MANAGEMENT // Internal extensions (see usages) |
| 562 }; |
| 563 |
| 564 Reason reason; |
| 565 |
| 566 // The extension being uninstalled - this should always be non-NULL. |
| 567 const Extension* extension; |
| 568 |
| 569 UninstalledExtensionInfo(const Extension* extension, Reason reason); |
| 570 }; |
| 571 |
546 // The details sent for EXTENSION_PERMISSIONS_UPDATED notifications. | 572 // The details sent for EXTENSION_PERMISSIONS_UPDATED notifications. |
547 struct UpdatedExtensionPermissionsInfo { | 573 struct UpdatedExtensionPermissionsInfo { |
548 enum Reason { | 574 enum Reason { |
549 ADDED, // The permissions were added to the extension. | 575 ADDED, // The permissions were added to the extension. |
550 REMOVED, // The permissions were removed from the extension. | 576 REMOVED, // The permissions were removed from the extension. |
551 }; | 577 }; |
552 | 578 |
553 Reason reason; | 579 Reason reason; |
554 | 580 |
555 // The extension who's permissions have changed. | 581 // The extension who's permissions have changed. |
556 const Extension* extension; | 582 const Extension* extension; |
557 | 583 |
558 // The permissions that have changed. For Reason::ADDED, this would contain | 584 // The permissions that have changed. For Reason::ADDED, this would contain |
559 // only the permissions that have added, and for Reason::REMOVED, this would | 585 // only the permissions that have added, and for Reason::REMOVED, this would |
560 // only contain the removed permissions. | 586 // only contain the removed permissions. |
561 const PermissionSet* permissions; | 587 const PermissionSet* permissions; |
562 | 588 |
563 UpdatedExtensionPermissionsInfo( | 589 UpdatedExtensionPermissionsInfo( |
564 const Extension* extension, | 590 const Extension* extension, |
565 const PermissionSet* permissions, | 591 const PermissionSet* permissions, |
566 Reason reason); | 592 Reason reason); |
567 }; | 593 }; |
568 | 594 |
569 } // namespace extensions | 595 } // namespace extensions |
570 | 596 |
571 #endif // EXTENSIONS_COMMON_EXTENSION_H_ | 597 #endif // EXTENSIONS_COMMON_EXTENSION_H_ |
OLD | NEW |