1// Copyright 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 5syntax = "proto2"; 6 7option optimize_for = LITE_RUNTIME; 8option java_package = "org.chromium.components.metrics"; 9 10option java_outer_classname = "ExtensionInstallProtos"; 11 12package metrics; 13 14// Stores information about an extension installed on a user's machine. 15// Next tag: 17. 16message ExtensionInstallProto { 17 // The type of extension item this is. 18 enum Type { 19 UNKNOWN_TYPE = 0; // Unknown (hopefully never used) 20 EXTENSION = 1; // A browser extension 21 THEME = 2; // A browser theme 22 USER_SCRIPT = 3; // An extension converted from a user script 23 HOSTED_APP = 4; // A hosted app 24 LEGACY_PACKAGED_APP = 5; // A (deprecated) v1 packaged app 25 PLATFORM_APP = 6; // A platform app 26 SHARED_MODULE = 7; // A shared module 27 LOGIN_SCREEN_EXTENSION = 8; // An extension running on the login screen 28 } 29 optional Type type = 1; 30 31 // The source of the extension. 32 enum InstallLocation { 33 UNKNOWN_LOCATION = 0; // Unknown (hopefully never used) 34 INTERNAL = 1; // A crx file from the internal Extensions directory; most 35 // webstore-installed extensions fall into this category. 36 EXTERNAL_PREF = 2; // A crx file from an external directory (via prefs). 37 EXTERNAL_REGISTRY = 3; // A crx file from an external directory (via the 38 // Windows registry) 39 UNPACKED = 4; // An unpacked extension loaded from chrome://extensions. 40 COMPONENT = 5; // An internal component extension. 41 EXTERNAL_PREF_DOWNLOAD = 6; // A crx file from an external directory (via 42 // prefs), downloaded from an update URL. 43 EXTERNAL_POLICY_DOWNLOAD = 7; // A crx file from an external directory (via 44 // admin policies), downloaded from an update 45 // URL. 46 COMMAND_LINE = 8; // Loaded from the commandline (e.g. --load-extension). 47 EXTERNAL_POLICY = 9; // A crx file from an external directory (via admin 48 // policies), cached locally and installed from the 49 // cache. 50 EXTERNAL_COMPONENT = 10; // A component extension that was downloaded 51 // externally via an update url. 52 } 53 optional InstallLocation install_location = 2; 54 55 // The manifest version in the extension. Note: this refers to the 56 // Chrome-required versioning of the manifest, not the extension version. 57 // Currently, it is always 1 or 2. 58 optional int32 manifest_version = 3; 59 60 // The associated UI action in the extension. Each extension can have at most 61 // one type of action. 62 enum ActionType { 63 NO_ACTION = 0; 64 BROWSER_ACTION = 1; 65 PAGE_ACTION = 2; 66 SYSTEM_INDICATOR = 3; 67 } 68 optional ActionType action_type = 4; 69 70 // If the extension has been granted file access. 71 optional bool has_file_access = 5; 72 73 // If the extension has been granted permission to run in incognito contexts. 74 optional bool has_incognito_access = 6; 75 76 // If the extension originated from the Chrome Web Store according to the 77 // prefs. 78 // This differs from install_location, which specifies from where the location 79 // on the user’s machine from where the install originated, but not whether 80 // the extension is hosted in the store. For instance, sideloaded extensions 81 // that are specified via ID in the registry are downloaded from the store. 82 optional bool is_from_store = 7; 83 84 // If the extension automatically updates from the Chrome Web Store. 85 optional bool updates_from_store = 8; 86 87 // If the extension is a bookmark app that was generated from a web page. This 88 // is distinct from install_location above, which specifies from where on the 89 // user’s machine the install originated. 90 optional bool is_from_bookmark = 9; 91 92 // If the extension was created from a user script. This is distinct from 93 // install_location above, which specifies from where on the user’s machine 94 // the install originated. 95 optional bool is_converted_from_user_script = 10; 96 97 // If the extension was installed by default when the profile was created. 98 // These extensions are specified by Chrome. 99 optional bool is_default_installed = 11; 100 101 // If the extension was installed by an OEM. This differs from 102 // "is_default_installed", since these extensions are specified by the OEM 103 // rather than by Chrome. These are specified in a file that is created as 104 // part of the creation of the Chrome image, and can be specific to different 105 // OEMs. 106 optional bool is_oem_installed = 12; 107 108 // The type of background page this extension has. Each extension can have at 109 // most one type of background presence. 110 enum BackgroundScriptType { 111 NO_BACKGROUND_SCRIPT = 0; // The extension has no background page. 112 PERSISTENT_BACKGROUND_PAGE = 1; // The extension has a persistent 113 // background page. 114 EVENT_PAGE = 2; // The extension has a (lazy) event page. 115 SERVICE_WORKER = 3; // The extension has a service worker based 116 // background context. 117 } 118 optional BackgroundScriptType background_script_type = 13; 119 120 // The reasons an extension may be disabled. 121 enum DisableReason { 122 USER_ACTION = 0; // The user disabled the extension. 123 PERMISSIONS_INCREASE = 1; // The extension increased permissions. 124 RELOAD = 2; // The extension is reloading. 125 UNSUPPORTED_REQUIREMENT = 3; // The extension has requirements that weren't 126 // met (e.g. graphics capabilities). 127 SIDELOAD_WIPEOUT = 4; // The extension was disabled in the sideload 128 // wipeout. 129 UNKNOWN_FROM_SYNC = 5; // The extension was disabled by sync. 130 NOT_VERIFIED = 6; // The extension couldn't be verified. 131 GREYLIST = 7; // The extension was found on the greylist. 132 CORRUPTED = 8; // The extension install was corrupted according to content 133 // verification. 134 REMOTE_INSTALL = 9; // The extension was installed remotely and hasn't been 135 // enabled. 136 EXTERNAL_EXTENSION = 10; // The extension was sideloaded and hasn't been 137 // enabled. 138 UPDATE_REQUIRED_BY_POLICY = 11; // Policy requires an unmet minimum 139 // version. 140 CUSTODIAN_APPROVAL_REQUIRED = 12; // The extension is pending custodian 141 // approval for a supervised user. 142 BLOCKED_BY_POLICY = 13; // The extension is disabled because it's blocked 143 // by enterprise policy. 144 // Deprecated: The extension is disabled because it's blocked due to mature 145 // content for supervised users. 146 DEPRECATED_BLOCKED_MATURE = 14; 147 // The extension is disabled due to having a malware attribute in the Omaha 148 // config. 149 DISABLE_REMOTELY_FOR_MALWARE = 15; 150 // The extension is being reinstalled. 151 REINSTALL = 16; 152 } 153 // Any DisableReasons in effect for the extension. An empty list means the 154 // extension is not disabled. Note that an extension that is not disabled may 155 // nonetheless not be running, e.g., terminated because the extension process 156 // was killed. 157 repeated DisableReason disable_reasons = 14; 158 159 // The state of the extension in the safe browsing blacklist. 160 // The numeric values here match the values of the respective enum in 161 // ClientCRXListInfoResponse proto. 162 enum BlacklistState { 163 // The extension is not in the blacklist. 164 NOT_BLACKLISTED = 0; 165 // The extension is malware. 166 BLACKLISTED_MALWARE = 1; 167 // The extension has a serious security vulnerability. 168 BLACKLISTED_SECURITY_VULNERABILITY = 2; 169 // The extension violated CWS policy. 170 BLACKLISTED_CWS_POLICY_VIOLATION = 3; 171 // The extension is considered potentially unwanted. 172 BLACKLISTED_POTENTIALLY_UNWANTED = 4; 173 // Used when we couldn't connect to server, e.g. when offline. 174 BLACKLISTED_UNKNOWN = 5; 175 } 176 optional BlacklistState blacklist_state = 15; 177 178 // Whether the extension was installed in the current sampling period. This 179 // is useful if trying to use extension installation in conjunction with other 180 // metrics (e.g. page load). Since some of the metrics from this period will 181 // have the extension installed and others won't, these records can be 182 // discarded for that analysis. 183 optional bool installed_in_this_sample_period = 16; 184} 185