File: workspace_desk_specifics.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 (309 lines) | stat: -rw-r--r-- 9,532 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
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Sync protocol datatype extension for desks on Chrome OS.

// If you change or add any fields in this file, update proto_visitors.h and
// potentially proto_enum_conversions.{h, cc}.

syntax = "proto2";

option java_multiple_files = true;
option java_package = "org.chromium.components.sync.protocol";

option optimize_for = LITE_RUNTIME;

package sync_pb;

import "components/sync/protocol/sync_enums.proto";

// A workspace desk entry. This proto contains the fields synced to represent
// a saved desk in user's workspace.
message WorkspaceDeskSpecifics {
  reserved "created_time_usec";

  // A random unique identifier for each desk.
  // Required.
  optional string uuid = 1;
  // The name of the desk being saved.
  optional string name = 2;
  // The time this snapshot of desk was created.
  optional int64 created_time_windows_epoch_micros = 3;

  // The time this snapshot of desk was updated.
  optional int64 updated_time_windows_epoch_micros = 5;

  optional Desk desk = 4;

  // The type of a desk.
  optional DeskType desk_type = 6;

  // The cache guid of the syncing client. Used to identify a unique device
  // that's syncing data.
  optional string client_cache_guid = 7;

  // The form factor of the device.
  optional SyncEnums.DeviceFormFactor device_form_factor = 8;

  // The list of Coral tab and app entities.
  optional CoralTabAppEntities coral_tab_app_entities = 9;

  // Represent a snapshot of the information on a desk.
  message Desk {
    // The apps in this template.
    repeated App apps = 1;
  }

  // A Launchable app in template.
  message App {
    // The on-display location of this window.
    optional WindowBound window_bound = 1;
    optional WindowState window_state = 2;
    // The z-index of this app relative to other apps in this template.
    // App with larger z-index appears in front of app with smaller z-index.
    optional int32 z_index = 3;

    optional AppOneOf app = 4;

    // window_id used to instantiate proto as a restore_data object.  The
    // restore_data object in question can be found at:
    // //components/app_restore/restore_data.h
    optional int32 window_id = 5;

    // Display ID this app is on.
    optional int64 display_id = 6;

    // State of a window before it was minimized. Empty/unset for non-minimized
    // windows.
    optional WindowState pre_minimized_window_state = 7;

    // Container this app was launched from.  Empty/unset for Arc apps.
    optional LaunchContainer container = 8;

    // Window open disposition, defines how a window opens. Empty/unset for Arc
    // apps.
    optional WindowOpenDisposition disposition = 9;

    // Name of the app which is used by the browser to determine whether to
    // launch an app as an app or a tab. Does not contain a human readable name
    // but contains the app ID and a prefix.
    optional string app_name = 10;

    // Human readable title of the app.
    optional string title = 11;

    // This is used to determine the size of a snapped window is in clamshell
    // mode. Empty/unset for non-snapped windows. This should be a value between
    // 0 and 100.
    optional int32 snap_percentage = 12;

    // The override URL can be specified by apps to override the default URL at
    // launch.
    optional string override_url = 13;
  }

  message AppOneOf {
    oneof app {
      BrowserAppWindow browser_app_window = 1;
      ChromeApp chrome_app = 2;
      ProgressiveWebApp progress_web_app = 3;
      ArcApp arc_app = 4;
    }
  }

  // A Chrome or Lacros Browser app window.
  message BrowserAppWindow {
    message BrowserAppTab {
      // The last committed URL of the main frame of the tab.
      optional string url = 1;
      // The title of the tab.
      optional string title = 2;
    }

    // Structure representing a tab group associated with this window.
    message TabGroup {
      // Zero-based index within the browser app tabs of the first tab in the
      // group.
      optional int32 first_index = 1;

      // Zero-based Index wotjom the browser app tabs of the last tab in the
      // group.
      optional int32 last_index = 2;

      // User readable title of the tab group.
      optional string title = 3;

      // Color associated with this tab group.
      optional TabGroupColor color = 4;

      // Indicates whether the tab group is collapsed.
      optional bool is_collapsed = 5;
    }

    // The tabs in this browser window.
    repeated BrowserAppTab tabs = 1;

    // The index of the currently active tab.
    optional int32 active_tab_index = 2;

    // Indicates whether to show as a dedicated app window.
    optional bool show_as_app = 3;

    // Tab groups associated with this window.
    repeated TabGroup tab_groups = 4;

    // The index of the first non-pinned tab.
    optional int32 first_non_pinned_tab_index = 5;
  }

  // A Chrome App window.
  message ChromeApp {
    // The Chrome App's App ID.
    optional string app_id = 1;

    reserved 2;
  }

  // A PWA window.
  message ProgressiveWebApp {
    // The PWA's App ID.
    optional string app_id = 1;

    reserved 2;
  }

  // An Arc App window.
  message ArcApp {
    // The Arc App's ID.
    optional string app_id = 1;

    // Arc window information.  This maps
    // to ArcExtraInfo in a WindowInfo struct.
    optional WindowSize minimum_size = 2;
    optional WindowSize maximum_size = 3;

    reserved 4;

    optional WindowBound bounds_in_root = 5;

    // maps to gfx::Size.  Width of the window, including the frame,
    // in pixels.
    message WindowSize {
      optional int32 width = 1;
      optional int32 height = 2;
    }
  }

  message WindowBound {
    // The offset of the window from the top edge of the screen in pixels.
    optional int32 top = 1;
    // The offset of the window from the left edge of the screen in pixels.
    optional int32 left = 2;
    // The width of the window, including the frame, in pixels.
    optional int32 width = 3;
    // The height of the window, including the frame, in pixels.
    optional int32 height = 4;
  }

  // Enumeration for the container an app was launched from as used by
  // (components/services/app_services/public/mojom/types.mojom:490).
  enum LaunchContainer {
    LAUNCH_CONTAINER_UNSPECIFIED = 0;
    LAUNCH_CONTAINER_WINDOW = 1;
    LAUNCH_CONTAINER_PANEL_DEPRECATED = 2;
    LAUNCH_CONTAINER_TAB = 3;
    LAUNCH_CONTAINER_NONE = 4;
  }

  // The state of a generic window.
  enum WindowState {
    UNKNOWN_WINDOW_STATE = 0;
    // Normal window state (not minimized, maximized, or fullscreen).
    NORMAL = 1;
    // Minimized window state.
    MINIMIZED = 2;
    // Maximized window state.
    MAXIMIZED = 3;
    // Fullscreen window state.
    FULLSCREEN = 4;
    // Snapped to primary half of the screen. Primary half is on the left in
    // landscape screen orientation and top in portrait screen orientation.
    PRIMARY_SNAPPED = 5;
    // Snapped to secondary half of the screen. Secondary half is on the right
    // in landscape screen orientation and bottom in portrait screen
    // orientation.
    SECONDARY_SNAPPED = 6;
    // Floated window state.
    FLOATED = 7;
  }

  // Enumeration for how a window opens.  Maps to base::WindowOpenDisposition.
  // (found in ui/base/window_open_disposition.h:10).  Does not include
  // MAX_VALUE as MAX_VALUE is equivalent to NEW_PICTURE_IN_PICTURE.  All
  // comments are copied verbatim from aforementioned header.
  enum WindowOpenDisposition {
    UNKNOWN = 0;
    CURRENT_TAB = 1;
    // Indicates that only one tab with the URL shoul exist in the same window.
    SINGLETON_TAB = 2;
    NEW_FOREGROUND_TAB = 3;
    NEW_BACKGROUND_TAB = 4;
    NEW_POPUP = 5;
    NEW_WINDOW = 6;
    SAVE_TO_DISK = 7;
    OFF_THE_RECORD = 8;
    IGNORE_ACTION = 9;
    // Activates an existing tab containing the URL, rather than navigating.
    // This is similar to SINGLETON_TAB, but searches across all windows
    // from the current profile and anymity (instead of tjust the current one);
    // closes the current tab on switching if the current ta was the NTP with
    // no session history; and behaves like CURRENT_TAB instead of
    // NEW_FOREGROUND_TAB when no existing tab is found.
    SWITCH_TO_TAB = 10;
    // creates a new document picture-in-picture window showing a child WebView.
    NEW_PICTURE_IN_PICTURE = 11;
  }

  // Enumerates the type of desk, namely to differentiate desks between desks
  // saved for desk templates and desks saved for save and recall.
  enum DeskType {
    UNKNOWN_TYPE = 0;
    TEMPLATE = 1;
    SAVE_AND_RECALL = 2;
    FLOATING_WORKSPACE = 3;
  }

  // Enumerates the possible colors that a tab group can have.  This mirrors
  // the enumeration that can be found in
  // components/tab_groups/tab_group_color.h
  enum TabGroupColor {
    UNKNOWN_COLOR = 0;
    GREY = 1;
    BLUE = 2;
    RED = 3;
    YELLOW = 4;
    GREEN = 5;
    PINK = 6;
    PURPLE = 7;
    CYAN = 8;
    ORANGE = 9;
  }

  // The tab and app entities used by Coral to avoid suggesting groups with a
  // similar topic.
  message CoralTabAppEntities {
    repeated CoralTabEntity tab_entities = 1;
    repeated CoralAppEntity app_entities = 2;
  }

  message CoralTabEntity {
    optional string tab_title = 1;
    optional string tab_url = 2;
  }

  message CoralAppEntity {
    optional string app_name = 1;
    optional string app_id = 2;
  }
}