saved_tab_group_specifics.proto 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Copyright 2022 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. // If you change or add any fields in this file, update proto_visitors.h and
  5. // potentially proto_enum_conversions.{h, cc}.
  6. syntax = "proto2";
  7. option java_multiple_files = true;
  8. option java_package = "org.chromium.components.sync.protocol";
  9. option optimize_for = LITE_RUNTIME;
  10. package sync_pb;
  11. // Sync protocol datatype extension for saved tab groups. Saved Tab Groups are
  12. // tab groups which can be recalled between browser sessions, and if sync is
  13. // turned on, cross device. A saved tab group contains tabs which are stored as
  14. // a SavedTabGroupSpecifics separately (SavedTabGroupTab). This is due to
  15. // limitations from the sync service on the size of an individual sync entity.
  16. message SavedTabGroup {
  17. // These colors map to tab_groups::TabGroupColorId. They DO NOT match the enum
  18. // integer values due to "kGrey" being in the "Unspecified" field.
  19. enum SavedTabGroupColor {
  20. SAVED_TAB_GROUP_COLOR_UNSPECIFIED = 0;
  21. SAVED_TAB_GROUP_COLOR_GREY = 1;
  22. SAVED_TAB_GROUP_COLOR_BLUE = 2;
  23. SAVED_TAB_GROUP_COLOR_RED = 3;
  24. SAVED_TAB_GROUP_COLOR_YELLOW = 4;
  25. SAVED_TAB_GROUP_COLOR_GREEN = 5;
  26. SAVED_TAB_GROUP_COLOR_PINK = 6;
  27. SAVED_TAB_GROUP_COLOR_PURPLE = 7;
  28. SAVED_TAB_GROUP_COLOR_CYAN = 8;
  29. SAVED_TAB_GROUP_COLOR_ORANGE = 9;
  30. }
  31. // The position of the SavedTabGroup in any visual display. This also
  32. // represents the index in the SavedTabGroupModel of the group.
  33. optional int64 position = 1;
  34. // The displayed title of the group, shown on the tab group and the saved tab
  35. // group button.
  36. optional string title = 2;
  37. // The color of the group, mapped to tab_groups::TabGroupColorId.
  38. optional SavedTabGroupColor color = 3;
  39. }
  40. // Sync protocol datatype extension for saved tab group tabs. SavedTabGroupTab
  41. // are the sync representation of a tab in a saved tab group. they are stored as
  42. // separate entities due to size limitations of sync entities.
  43. message SavedTabGroupTab {
  44. // An id that links the saved tab group tab to it's saved tab group.
  45. optional string group_guid = 1;
  46. // The position in the Tab Strip the tab is located relative to the start of
  47. // the tab group. This is also the index in the saved_tabs_ vector in the
  48. // SavedTabGroup in the SavedTabGroupModel, which is updated by the
  49. // TabStripModel.
  50. optional int64 position = 2;
  51. // Tab Data used for constructing the tab.
  52. optional string url = 3;
  53. }
  54. message SavedTabGroupSpecifics {
  55. // An id that refers to the sync saved tab group object.
  56. optional string guid = 1;
  57. // Timestamps for CRUD operations.
  58. optional int64 creation_time_windows_epoch_micros = 2;
  59. optional int64 update_time_windows_epoch_micros = 3;
  60. oneof entity {
  61. SavedTabGroup group = 4;
  62. SavedTabGroupTab tab = 5;
  63. }
  64. }