File: saved_tab_group_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 (105 lines) | stat: -rw-r--r-- 3,967 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
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// 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/tab_group_attribution_metadata.proto";

// LINT.IfChange(SavedTabGroupSpecifics)
// Sync protocol datatype extension for saved tab groups. Saved Tab Groups are
// tab groups which can be recalled between browser sessions, and if sync is
// turned on, cross device. A saved tab group contains tabs which are stored as
// a SavedTabGroupSpecifics separately (SavedTabGroupTab). This is due to
// limitations from the sync service on the size of an individual sync entity.
message SavedTabGroup {
  // These colors map to tab_groups::TabGroupColorId. They DO NOT match the enum
  // integer values due to "kGrey" being in the "Unspecified" field.
  enum SavedTabGroupColor {
    SAVED_TAB_GROUP_COLOR_UNSPECIFIED = 0;
    SAVED_TAB_GROUP_COLOR_GREY = 1;
    SAVED_TAB_GROUP_COLOR_BLUE = 2;
    SAVED_TAB_GROUP_COLOR_RED = 3;
    SAVED_TAB_GROUP_COLOR_YELLOW = 4;
    SAVED_TAB_GROUP_COLOR_GREEN = 5;
    SAVED_TAB_GROUP_COLOR_PINK = 6;
    SAVED_TAB_GROUP_COLOR_PURPLE = 7;
    SAVED_TAB_GROUP_COLOR_CYAN = 8;
    SAVED_TAB_GROUP_COLOR_ORANGE = 9;
  }

  // The position of the SavedTabGroup in any visual display. This also
  // represents the index in the SavedTabGroupModel of the group. This field
  // will be deprecated and replaced by the pinned_position field in tab group
  // V2.
  optional int64 position = 1;

  // The displayed title of the group, shown on the tab group and the saved tab
  // group button.
  optional string title = 2;

  // The color of the group, mapped to tab_groups::TabGroupColorId.
  optional SavedTabGroupColor color = 3;

  // Position of the pinned tab group in bookmark bar on Desktop. This will
  // replace the position field in Tab Group V2.
  optional int64 pinned_position = 4;

  reserved 5;
}

// Sync protocol datatype extension for saved tab group tabs. SavedTabGroupTab
// are the sync representation of a tab in a saved tab group. they are stored as
// separate entities due to size limitations of sync entities.
message SavedTabGroupTab {
  // An id that links the saved tab group tab to it's saved tab group.
  optional string group_guid = 1;

  // The position in the Tab Strip the tab is located relative to the start of
  // the tab group. This is also the index in the saved_tabs_ vector in the
  // SavedTabGroup in the SavedTabGroupModel, which is updated by the
  // TabStripModel.
  optional int64 position = 2;

  // Tab Data used for constructing the tab.
  optional string url = 3;

  // The displayed title of the tab, shown on the saved tab group button's
  // context menu.
  optional string title = 4;
}

message SavedTabGroupSpecifics {
  // An id that refers to the sync saved tab group object.
  optional string guid = 1;

  // Timestamps for CRUD operations.
  optional int64 creation_time_windows_epoch_micros = 2;
  optional int64 update_time_windows_epoch_micros = 3;

  oneof entity {
    SavedTabGroup group = 4;
    SavedTabGroupTab tab = 5;
  }

  // Attribution metadata about the associated tab group or tab.
  optional AttributionMetadata attribution_metadata = 6;

  // A mechanism to identify the client version that wrote this specifics.
  // Designed to aid business logic when reading newly added fields that
  // didn't exist in older clients.
  // The client version must be incremented whenever a new field is added to the
  // specifics.
  optional int32 version = 7;
}
// LINT.ThenChange(//components/saved_tab_groups/internal/saved_tab_group_sync_bridge.cc:TrimAllSupportedFieldsFromRemoteSpecifics)