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