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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 // Used to record the reason an extension was disabled. | 71 // Used to record the reason an extension was disabled. |
72 enum DeprecatedDisableReason { | 72 enum DeprecatedDisableReason { |
73 DEPRECATED_DISABLE_UNKNOWN, | 73 DEPRECATED_DISABLE_UNKNOWN, |
74 DEPRECATED_DISABLE_USER_ACTION, | 74 DEPRECATED_DISABLE_USER_ACTION, |
75 DEPRECATED_DISABLE_PERMISSIONS_INCREASE, | 75 DEPRECATED_DISABLE_PERMISSIONS_INCREASE, |
76 DEPRECATED_DISABLE_RELOAD, | 76 DEPRECATED_DISABLE_RELOAD, |
77 DEPRECATED_DISABLE_LAST, // Not used. | 77 DEPRECATED_DISABLE_LAST, // Not used. |
78 }; | 78 }; |
79 | 79 |
| 80 // Reasons an extension may be disabled. These are used in histograms, so do |
| 81 // not remove/reorder entries - only add at the end just before |
| 82 // DISABLE_REASON_LAST (and update the shift value for it). Also remember to |
| 83 // update the enum listing in tools/metrics/histograms.xml. |
80 enum DisableReason { | 84 enum DisableReason { |
81 DISABLE_NONE = 0, | 85 DISABLE_NONE = 0, |
82 DISABLE_USER_ACTION = 1 << 0, | 86 DISABLE_USER_ACTION = 1 << 0, |
83 DISABLE_PERMISSIONS_INCREASE = 1 << 1, | 87 DISABLE_PERMISSIONS_INCREASE = 1 << 1, |
84 DISABLE_RELOAD = 1 << 2, | 88 DISABLE_RELOAD = 1 << 2, |
85 DISABLE_UNSUPPORTED_REQUIREMENT = 1 << 3, | 89 DISABLE_UNSUPPORTED_REQUIREMENT = 1 << 3, |
86 DISABLE_SIDELOAD_WIPEOUT = 1 << 4, | 90 DISABLE_SIDELOAD_WIPEOUT = 1 << 4, |
87 DISABLE_UNKNOWN_FROM_SYNC = 1 << 5, | 91 DISABLE_UNKNOWN_FROM_SYNC = 1 << 5, |
88 // DISABLE_PERMISSIONS_CONSENT = 1 << 6, // Deprecated. | 92 // DISABLE_PERMISSIONS_CONSENT = 1 << 6, // Deprecated. |
89 // DISABLE_KNOWN_DISABLED = 1 << 7, // Deprecated. | 93 // DISABLE_KNOWN_DISABLED = 1 << 7, // Deprecated. |
90 DISABLE_NOT_VERIFIED = 1 << 8, // Disabled because we could not verify | 94 DISABLE_NOT_VERIFIED = 1 << 8, // Disabled because we could not verify |
91 // the install. | 95 // the install. |
92 DISABLE_GREYLIST = 1 << 9, | 96 DISABLE_GREYLIST = 1 << 9, |
93 DISABLE_CORRUPTED = 1 << 10, | 97 DISABLE_CORRUPTED = 1 << 10, |
94 DISABLE_REMOTE_INSTALL = 1 << 11 | 98 DISABLE_REMOTE_INSTALL = 1 << 11, |
| 99 DISABLE_REASON_LAST = 1 << 12, // This should always be the last value |
95 }; | 100 }; |
96 | 101 |
97 // A base class for parsed manifest data that APIs want to store on | 102 // A base class for parsed manifest data that APIs want to store on |
98 // the extension. Related to base::SupportsUserData, but with an immutable | 103 // the extension. Related to base::SupportsUserData, but with an immutable |
99 // thread-safe interface to match Extension. | 104 // thread-safe interface to match Extension. |
100 struct ManifestData { | 105 struct ManifestData { |
101 virtual ~ManifestData() {} | 106 virtual ~ManifestData() {} |
102 }; | 107 }; |
103 | 108 |
104 // Do not change the order of entries or remove entries in this list | 109 // Do not change the order of entries or remove entries in this list |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 | 559 |
555 UpdatedExtensionPermissionsInfo( | 560 UpdatedExtensionPermissionsInfo( |
556 const Extension* extension, | 561 const Extension* extension, |
557 const PermissionSet* permissions, | 562 const PermissionSet* permissions, |
558 Reason reason); | 563 Reason reason); |
559 }; | 564 }; |
560 | 565 |
561 } // namespace extensions | 566 } // namespace extensions |
562 | 567 |
563 #endif // EXTENSIONS_COMMON_EXTENSION_H_ | 568 #endif // EXTENSIONS_COMMON_EXTENSION_H_ |
OLD | NEW |