File: web_app.proto

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (461 lines) | stat: -rw-r--r-- 17,671 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";

import "components/sync/protocol/web_app_specifics.proto";
import "chrome/browser/web_applications/proto/web_app_launch_handler.proto";
import "chrome/browser/web_applications/proto/web_app_os_integration_state.proto";
import "chrome/browser/web_applications/proto/web_app_install_state.proto";
import "chrome/browser/web_applications/proto/web_app_isolation_data.proto";
import "chrome/browser/web_applications/proto/web_app_related_applications.proto";
import "chrome/browser/web_applications/proto/web_app_share_target.proto";
import "chrome/browser/web_applications/proto/web_app_tab_strip.proto";
import "chromeos/ash/experiences/system_web_apps/types/proto/system_web_app_data.proto";

option optimize_for = LITE_RUNTIME;

package web_app.proto;

// A mapping between a MIME type and a set of file extensions for a file handler
// "accept" entry. See chrome/browser/web_applications/web_app.h for details.
message WebAppFileHandlerAccept {
  optional string mimetype = 1;  // Required.
  repeated string file_extensions = 2;
}

// A file handler "action" associated with a set of "accept" entries, each of
// which specifies a MIME type and corresponding set of file extensions that the
// handler can handle. See chrome/browser/web_applications/web_app.h for
// details.
message WebAppFileHandler {
  optional string action = 1;  // Required.
  repeated WebAppFileHandlerAccept accept = 2;
  repeated sync_pb.WebAppIconInfo downloaded_icons = 3;
  optional string display_name = 4;

  // This enum should be synced with `LaunchType` in `apps::FileHandler`.
  enum LaunchType {
    LAUNCH_TYPE_UNSPECIFIED = 0;
    LAUNCH_TYPE_SINGLE_CLIENT = 1;
    LAUNCH_TYPE_MULTIPLE_CLIENTS = 2;
  }
  optional LaunchType launch_type = 5;  // Required.
}

enum LinkCapturingUserPreference {
  NAVIGATION_CAPTURING_PREFERENCE_DEFAULT = 0;
  NAVIGATION_CAPTURING_PREFERENCE_CAPTURE = 1;
  NAVIGATION_CAPTURING_PREFERENCE_DO_NOT_CAPTURE = 2;
}

message WebAppProtocolHandler {
  optional string protocol = 1;  // Required.
  optional string url = 2;       // Required.
}

// Represents a parsed and validated scope extension defined in the web app's
// manifest. The `scope` field is a full URL, not only the path.
message WebAppScopeExtension {
  optional string origin = 1;             // Required.
  optional bool has_origin_wildcard = 2;  // Required.
  optional string scope = 3;              // Required.
}

// A set to track simultaneous installs and uninstalls from multiple install
// sources. This should stay in sync with |WebAppManagement| in
// chrome/browser/web_applications/web_app_constants.h
// and the WebAppManagement enum below.
message Sources {
  optional bool system = 1;
  optional bool policy = 2;
  optional bool web_app_store = 3;
  optional bool sync = 4;
  optional bool default = 5;
  optional bool sub_app = 6;
  optional bool kiosk = 7;
  reserved 8;
  optional bool oem = 9;
  optional bool one_drive_integration = 10;
  optional bool aps_default = 11;
  optional bool iwa_shimless_rma = 12;
  optional bool iwa_policy = 13;
  optional bool iwa_user_installed = 14;
  optional bool user_installed = 15;
}

// Properties for integrating with Chrome OS.
message ChromeOSData {
  optional bool show_in_launcher = 1;
  optional bool show_in_search_and_shelf = 2;
  optional bool show_in_management = 3;
  optional bool is_disabled = 4;
  optional bool oem_installed = 5;
  optional bool handles_file_open_intents = 6;
  reserved 7;
}

message ClientData {
  optional ash.SystemWebAppDataProto system_web_app_data = 1;
}

// Properties for a WebApp's shortcuts menu item.
message WebAppShortcutsMenuItemInfo {
  optional string name = 1;  // Required.
  optional string url = 2;   // Required.
  repeated sync_pb.WebAppIconInfo shortcut_manifest_icons = 3;
  repeated sync_pb.WebAppIconInfo shortcut_manifest_icons_maskable = 4;
  repeated sync_pb.WebAppIconInfo shortcut_manifest_icons_monochrome = 5;
}

// List of icon sizes downloaded to disk for a shortcuts menu item.
message DownloadedShortcutsMenuIconSizes {
  repeated int32 icon_sizes = 1;
  repeated int32 icon_sizes_maskable = 2;
  repeated int32 icon_sizes_monochrome = 3;
}

message WebAppPermissionsPolicy {
  optional string feature = 1;
  repeated string allowed_origins = 2;
  optional bool matches_all_origins = 3;
  optional bool matches_opaque_src = 4;
}

// This enum should be synced with |WebAppManagement| in
// chrome/browser/web_applications/web_app_constants.h as well as
// with the Sources message defined above.
enum WebAppManagementType {
  WEB_APP_MANAGEMENT_TYPE_UNSPECIFIED = 0;
  WEB_APP_MANAGEMENT_TYPE_SYSTEM = 1;
  WEB_APP_MANAGEMENT_TYPE_POLICY = 2;
  WEB_APP_MANAGEMENT_TYPE_SUB_APP = 3;
  WEB_APP_MANAGEMENT_TYPE_WEB_APP_STORE = 4;
  WEB_APP_MANAGEMENT_TYPE_SYNC = 5;
  WEB_APP_MANAGEMENT_TYPE_DEFAULT = 6;
  WEB_APP_MANAGEMENT_TYPE_KIOSK = 7;
  reserved 8;
  WEB_APP_MANAGEMENT_TYPE_OEM = 9;
  WEB_APP_MANAGEMENT_TYPE_ONE_DRIVE_INTEGRATION = 10;
  WEB_APP_MANAGEMENT_TYPE_APS_DEFAULT = 11;
  WEB_APP_MANAGEMENT_TYPE_IWA_SHIMLESS_RMA = 12;
  WEB_APP_MANAGEMENT_TYPE_IWA_POLICY = 13;
  WEB_APP_MANAGEMENT_TYPE_IWA_USER_INSTALLED = 14;
  WEB_APP_MANAGEMENT_TYPE_USER_INSTALLED = 15;
}

// This stores data per-external-WebAppManagement::Type, as each installation
// manager can have different installation configurations for the same web app.
message ManagementToExternalConfigInfo {
  optional WebAppManagementType management = 1;
  // The collection of install_urls per web_app per WebAppManagement::Type.
  repeated string install_urls = 2;
  // Stores whether the app is a placeholder app or not.
  optional bool is_placeholder = 3;
  // A list of additional terms to use when matching this app against
  // identifiers in admin policies (for shelf pinning, default file handlers,
  // etc) per web_app per WebAppManagement::Type.
  // Note that list is not meant to be an exhaustive enumeration of all possible
  // policy_ids but rather just a supplement for tricky cases.
  repeated string additional_policy_ids = 4;
}

// The initiator of a sync generated icon fix time window.
enum GeneratedIconFixSource {
  GENERATED_ICON_FIX_SOURCE_UNKNOWN = 0;
  GENERATED_ICON_FIX_SOURCE_SYNC_INSTALL = 1;
  GENERATED_ICON_FIX_SOURCE_RETROACTIVE = 2;
  GENERATED_ICON_FIX_SOURCE_MANIFEST_UPDATE = 3;
};

// Represents the current state of attempts to fix broken icons from sync
// installed web apps.
message GeneratedIconFix {
  optional GeneratedIconFixSource source = 1;  // Required.

  optional int64 window_start_time = 2;  // Required.

  optional int64 last_attempt_time = 3;

  optional uint32 attempt_count = 4;  // Required.
}

// Full WebApp object data. See detailed comments in
// chrome/browser/web_applications/web_app.h. Note on database identities:
// app_id is a hash of launch_url. app_id is the client tag for sync system.
// app_id is the storage key in DataTypeStore.
message WebApp {
  reserved "handle_links", "is_in_sync_install", "is_placeholder",
      "file_handler_os_integration_state",
      "run_on_os_login_os_integration_state", "url_handlers", "update_token";
  // Synced data. It is replicated across , all devices with WEB_APPS.
  //
  // |sync_data.name| and |sync_data.theme_color| are read by a device to
  // generate a placeholder icon. Any device may write new values to synced
  // |name| and |theme_color|. A random last update wins.
  optional sync_pb.WebAppSpecifics sync_data = 1;  // Required.

  // This enum should be synced with
  // third_party/blink/public/mojom/manifest/display_mode.mojom
  enum DisplayMode {
    DISPLAY_MODE_UNSPECIFIED = 0;
    DISPLAY_MODE_BROWSER = 1;
    DISPLAY_MODE_MINIMAL_UI = 2;
    DISPLAY_MODE_STANDALONE = 3;
    DISPLAY_MODE_FULLSCREEN = 4;
    DISPLAY_MODE_WINDOW_CONTROLS_OVERLAY = 5;
    DISPLAY_MODE_TABBED = 6;
    DISPLAY_MODE_BORDERLESS = 7;
    DISPLAY_MODE_PICTURE_IN_PICTURE = 8;
  }

  // Local data. May vary across devices. Not to be synced.
  //
  optional string name = 2;  // Required.
  optional uint32 theme_color = 3;
  optional string description = 4;
  optional DisplayMode display_mode = 5;
  optional string scope = 6;
  optional Sources sources = 7;  // Required.
  // This used to be `bool is_locally_installed`.
  required proto.InstallState install_state = 8;  // Required.

  // Installation state:
  // Specifies if this web app is from sync and has not completed installation.
  // If true, this entity will be re-installed on startup.
  optional bool is_from_sync_and_pending_installation = 9;

  repeated sync_pb.WebAppIconInfo manifest_icons = 10;

  // A list of icon sizes we successfully downloaded to store on disk, for icons
  // that are suitable for any purpose (ie. IconPurpose::ANY). See also:
  // |downloaded_icon_sizes_purpose_monochrome|.
  repeated int32 downloaded_icon_sizes_purpose_any = 11;

  // A list of file handlers.
  repeated WebAppFileHandler file_handlers = 12;

  // A list of additional search terms to use when searching for the app.
  repeated string additional_search_terms = 13;

  // Even though |chromeos_data| is optional, it should always exist on
  // ChromeOS.
  optional ChromeOSData chromeos_data = 14;

  // Last time the app is launched.
  // ms since the Unix epoch. See sync/base/time.h.
  optional int64 last_launch_time = 15;

  // Time the app is installed.
  // ms since the Unix epoch. See sync/base/time.h.
  optional int64 first_install_time = 16;

  // A list of protocol handlers.
  repeated WebAppProtocolHandler protocol_handlers = 17;

  // Represents whether the icons for the web app are generated by Chrome due to
  // no suitable icons being available.
  optional bool is_generated_icon = 18;

  // A list of Shortcuts Menu items specified in the Web App Manifest.
  repeated WebAppShortcutsMenuItemInfo shortcuts_menu_item_infos = 19;
  // A list of icon sizes we successfully downloaded to store on disk.
  repeated DownloadedShortcutsMenuIconSizes
      downloaded_shortcuts_menu_icons_sizes = 20;

  optional uint32 background_color = 21;

  // A list of display modes specified in app manifest.
  repeated DisplayMode display_mode_override = 22;

  // A list of icon sizes we successfully downloaded to store on disk, for icons
  // that are designed for masking (ie. IconPurpose::MASKABLE). See also:
  // |downloaded_icon_sizes_purpose_any|.
  repeated int32 downloaded_icon_sizes_purpose_maskable = 23;

  // Run on OS Login modes for web app.
  // See chrome/browser/web_applications/web_app_constants.h
  // for web_app::RunOnOsLoginMode definition, which this enum should be in sync
  // with.
  enum RunOnOsLoginMode {
    // NOT_RUN if optional |user_run_on_os_login_mode| is absent.
    RUN_ON_OS_LOGIN_MODE_NOT_RUN = 0;
    RUN_ON_OS_LOGIN_MODE_WINDOWED = 1;
    RUN_ON_OS_LOGIN_MODE_MINIMIZED = 2;
  }
  // User preference: Run on OS Login mode for web app.
  // If present, the web app is configured to run on OS login.
  optional RunOnOsLoginMode user_run_on_os_login_mode = 24;

  optional ShareTarget share_target = 25;

  optional string launch_query_params = 26;

  reserved 27;

  optional ClientData client_data = 28;

  // This enum should be synced with |CaptureLinks| in
  // third_party/blink/public/mojom/manifest/capture_links.mojom
  enum CaptureLinks {
    // UNDEFINED if optional |capture_links| is absent.
    NONE = 1;
    NEW_CLIENT = 2;
    EXISTING_CLIENT_NAVIGATE = 3;
  }

  optional CaptureLinks capture_links = 29;

  optional string manifest_url = 30;

  // Last time the Badging API was used.
  // ms since the Unix epoch. See sync/base/time.h.
  optional int64 last_badging_time = 31;

  optional bool file_handler_permission_blocked = 32;

  // A list of icon sizes we successfully downloaded to store on disk for
  // monochrome icons. (IconPurpose::MONOCHROME). See also:
  // |downloaded_icon_sizes_purpose_any|,
  // |downloaded_icon_sizes_purpose_maskable|.
  repeated int32 downloaded_icon_sizes_purpose_monochrome = 33;

  optional bool window_controls_overlay_enabled = 34;

  // If present, the URL to use to create a new note in the app.
  optional string note_taking_new_note_url = 35;

  // A list of allowed launch protocols when launching the app with a protocol
  // url. This list is checked to see if we can bypass the permission dialog
  // when launching the web app.
  repeated string allowed_launch_protocols = 37;

  optional LaunchHandler launch_handler = 38;

  // Time the app is updated.
  // ms since the Unix epoch. See sync/base/time.h.
  optional int64 manifest_update_time = 39;

  // A list of disallowed launch protocols. The user has elected to never
  // allow these protocols be launched in the web app.
  repeated string disallowed_launch_protocols = 40;

  // A theme color to be used when the app is opened in dark mode.
  optional uint32 dark_mode_theme_color = 41;

  // Should be kept in sync with `ApiApprovalState` in web_app_constants.h.
  enum ApiApprovalState {
    REQUIRES_PROMPT = 0;
    ALLOWED = 1;
    DISALLOWED = 2;
  }

  optional ApiApprovalState file_handler_approval_state = 42;

  // For apps installed via the SubApp API, ID of the parent app that installed
  // the Sub-app.
  optional string parent_app_id = 43;

  // A background color to be used when the app is opened in dark mode.
  optional uint32 dark_mode_background_color = 44;

  // Specifies if this web app is currently being uninstalled. If true on
  // startup, it's assumed there was a crash or other error during
  // uninstallation, and the uninstallation will be tried again.
  optional bool is_uninstalling = 45;

  reserved 46;

  // Whether the app should show up in file-open intent and picking surfaces.
  optional bool handles_file_open_intents = 47;

  reserved 48;

  // Contains the permissions policy that should be applied to the web app.
  repeated WebAppPermissionsPolicy permissions_policy = 49;

  // The source that triggered the latest install. This is a
  // `webapps::WebappInstallSource` encoded as an integer.
  optional uint32 latest_install_source = 50;

  reserved 51;

  // Map of WebAppManagement enum to placeholder info and install_urls.
  // There should be only one entry per WebAppManagement source.
  repeated ManagementToExternalConfigInfo management_to_external_config_info =
      52;

  reserved 53;

  // The amount of storage (in bytes) used by the app and its related data.
  optional uint64 app_size_in_bytes = 54;
  optional uint64 data_size_in_bytes = 55;

  // If present, the URL to use to launch the app on the lock screen.
  optional string lock_screen_start_url = 56;

  // Contains customisations to the web app tab strip. Only present when the
  // display_mode is tabbed.
  optional TabStrip tab_strip = 57;

  // Only used on Mac OS, stores whether the app should always show the
  // toolbar when in fullscreen mode.
  optional bool always_show_toolbar_in_fullscreen = 58;

  // Contains the os_integration_state currently deployed for a web_app.
  // This will be populated from the fields in this proto when ran for the first
  // time after OS hooks have been registered.
  optional os_state.WebAppOsIntegration current_os_integration_states = 59;

  // If present, signals that this app is an Isolated Web App, and contains
  // IWA-specific information like bundle location.
  optional IsolationData isolation_data = 60;

  // Contains web origins that are part of the app's extended scope.
  repeated WebAppScopeExtension scope_extensions = 61;

  // The same as scope_extensions but filtered to origins that have validated
  // associations with this web app. See
  // https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md
  // for association requirements.
  repeated WebAppScopeExtension scope_extensions_validated = 62;

  // Stores whether the current web app is set as the default app to capture
  // links.
  optional LinkCapturingUserPreference user_link_capturing_preference = 63;

  // Time the app was updated as part of a full install. For example when a
  // policy installs an app that is already in the DB installed as a
  // default/sync installed app and the DB data is overwritten. ms since the
  // Unix epoch. See sync/base/time.h.
  optional int64 latest_install_time = 64;

  // Contains bookkeeping details about attempts to fix broken icons from sync
  // installed web apps.
  optional GeneratedIconFix generated_icon_fix = 65;

  // Records the number of times the user has ignored/dismissed the offer to
  // turn on user link capturing after launching the app via the intent picker,
  // specifically from the `EnableLinkCapturingInfoBarDelegate`.
  optional int32 supported_links_offer_ignore_count = 66;
  optional int32 supported_links_offer_dismiss_count = 67;

  // Set to true if the app was installed via the DIY app install path by the
  // user (3-dot menu, Install page as App...). DIY apps aren't promotable or
  // installable, and the user can customize its name.
  optional bool is_diy_app = 68;

  // Set to true if the app was installed via the shortcut app install path by
  // the user and was migrated to being a DIY app.
  optional bool was_shortcut_app = 69;

  // The related applications field of the manifest for installed web apps.
  repeated proto.RelatedApplications related_applications = 70;

  // Only used on Mac OS, Set to true if the app was installed via the DIY app
  // install path by the user and had new icons.
  optional bool diy_app_icons_masked_on_mac = 71;

  reserved 72;
}