// Copyright 2024 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";

option optimize_for = LITE_RUNTIME;

package tab_groups.proto;

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

// Message to store local-only data for a shared tab group entity. The message
// is binary compatible with LocalTabGroupData.
message LocalSharedTabGroupData {
  // Local tab group ID. Stored as a serialized base::Token.
  optional string local_group_id = 1;

  // Whether the tab group is transitioning from shared to saved, but not
  // yet completed.
  optional bool is_transitioning_to_saved = 2;

  // Whether the group should be hidden from UI and not be shown to the user.
  // For example, the originating shared tab groups will be hidden after
  // transitioning to saved groups.
  optional bool is_group_hidden = 3;

  // Whether the originating tab group should be used by the signed in user (or
  // whether the user is the owner of the originating tab group).
  optional bool use_originating_tab_group_guid = 4;
}

// Message to store shared tab groups in DataTypeStore.
message SharedTabGroupData {
  // Data from sync, contains either a SavedTabGroup or SavedTabGroupTab
  // (determined by the "entity" oneof field within). Contains only shared tab
  // group data.
  optional sync_pb.SharedTabGroupDataSpecifics specifics = 1;

  // Local-only metadata for the shared tab group. Only populated if the
  // `specifics` field contains a group entity.
  optional LocalSharedTabGroupData local_group_data = 2;
}
