blob: 53040afeaeca2072cabbabd18a23a0e299eabffe [file] [log] [blame]
Minh X. Nguyen45479012017-08-18 21:35:361// Copyright (c) 2017 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Devlin Croninbffe949eb2018-01-12 03:03:405#ifndef EXTENSIONS_BROWSER_DISABLE_REASON_H_
6#define EXTENSIONS_BROWSER_DISABLE_REASON_H_
Minh X. Nguyen45479012017-08-18 21:35:367
Karan Bhatia2a117232017-08-23 00:24:568#include <limits>
9
Minh X. Nguyen45479012017-08-18 21:35:3610namespace extensions {
11namespace disable_reason {
12
13// Reasons a Chrome extension may be disabled. These are used in histograms, so
14// do not remove/reorder entries - only add at the end just before
15// DISABLE_REASON_LAST (and update the shift value for it). Also remember to
16// update the enum listing in tools/metrics/histograms.xml.
17// Also carefully consider if your reason should sync to other devices, and if
18// so, add it to kKnownSyncableDisableReasons in
19// chrome/browser/extensions/extension_sync_service.cc.
Samuel Huang7987ebd2019-04-08 13:01:3720// Finally, consider whether your disable reason applies to component
21// extensions. Reference/update the existing list of applicable reasons in
22// ExtensionsPrefs::ClearInapplicableDisableReasonsForComponentExtension.
Minh X. Nguyen45479012017-08-18 21:35:3623enum DisableReason {
24 DISABLE_NONE = 0,
25 DISABLE_USER_ACTION = 1 << 0,
26 DISABLE_PERMISSIONS_INCREASE = 1 << 1,
27 DISABLE_RELOAD = 1 << 2,
28 DISABLE_UNSUPPORTED_REQUIREMENT = 1 << 3,
29 DISABLE_SIDELOAD_WIPEOUT = 1 << 4,
30 DEPRECATED_DISABLE_UNKNOWN_FROM_SYNC = 1 << 5,
31 // DISABLE_PERMISSIONS_CONSENT = 1 << 6, // Deprecated.
32 // DISABLE_KNOWN_DISABLED = 1 << 7, // Deprecated.
33 // Disabled because we could not verify the install.
34 DISABLE_NOT_VERIFIED = 1 << 8,
35 DISABLE_GREYLIST = 1 << 9,
36 DISABLE_CORRUPTED = 1 << 10,
37 DISABLE_REMOTE_INSTALL = 1 << 11,
38 // DISABLE_INACTIVE_EPHEMERAL_APP = 1 << 12, // Deprecated.
39 // External extensions might be disabled for user prompting.
40 DISABLE_EXTERNAL_EXTENSION = 1 << 13,
41 // Doesn't meet minimum version requirement.
42 DISABLE_UPDATE_REQUIRED_BY_POLICY = 1 << 14,
43 // Supervised user needs approval by custodian.
44 DISABLE_CUSTODIAN_APPROVAL_REQUIRED = 1 << 15,
Karan Bhatia2a117232017-08-23 00:24:5645 // Blocked due to management policy.
46 DISABLE_BLOCKED_BY_POLICY = 1 << 16,
Minh X. Nguyen45479012017-08-18 21:35:3647 // This should always be the last value.
Karan Bhatia2a117232017-08-23 00:24:5648 DISABLE_REASON_LAST = 1LL << 17,
Minh X. Nguyen45479012017-08-18 21:35:3649};
50
Karan Bhatia2a117232017-08-23 00:24:5651static_assert(DISABLE_REASON_LAST - 1 <= std::numeric_limits<int>::max(),
52 "The DisableReason bitmask cannot be stored in an int.");
53
Minh X. Nguyen45479012017-08-18 21:35:3654} // namespace disable_reason
55} // namespace extensions
56
Devlin Croninbffe949eb2018-01-12 03:03:4057#endif // EXTENSIONS_BROWSER_DISABLE_REASON_H_