summaryrefslogtreecommitdiffstats
path: root/sync/protocol/session_specifics.proto
blob: 07323b188d6c76635d05cdf8bd905ed3e6cc0342 (plain)
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
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// 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 sessions.

// Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
// any fields in this file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;
option retain_unknown_fields = true;

package sync_pb;

message SessionSpecifics {
  // Unique id for the client.
  optional string session_tag = 1;
  optional SessionHeader header = 2;
  optional SessionTab tab = 3;
}
// Properties of session sync objects.
message SessionHeader {
  // Each session is composed of windows.
  repeated SessionWindow window = 2;
  // A non-unique but human-readable name to describe this client.
  optional string client_name = 3;
  // The type of device.
  enum DeviceType {
    TYPE_WIN = 1;
    TYPE_MAC = 2;
    TYPE_LINUX = 3;
    TYPE_CROS = 4;
    TYPE_OTHER = 5;
    TYPE_PHONE = 6;
    TYPE_TABLET = 7;
  }
  optional DeviceType device_type = 4;
}
message SessionWindow {
  // Unique (to the owner) id for this window.
  optional int32 window_id = 1;
  // Index of the selected tab in tabs; -1 if no tab is selected.
  optional int32 selected_tab_index = 2 [default = -1];
  // Type of the browser. Currently we only store browsers of type
  // TYPE_TABBED and TYPE_POPUP.
  enum BrowserType {
    TYPE_TABBED = 1;
    TYPE_POPUP = 2;
  }
  optional BrowserType browser_type = 3 [default = TYPE_TABBED];
  // The tabs that compose a window (correspond to tab id's).
  repeated int32 tab = 4;
}
message SessionTab {
  // Unique (to the owner) id for this tab.
  optional int32 tab_id = 1;
  // The unique id for the window this tab belongs to.
  optional int32 window_id = 2;
  // Visual index of the tab within its window. There may be gaps in these
  // values.
  optional int32 tab_visual_index = 3 [default = -1];
  // Identifies the index of the current navigation in navigations. For
  // example, if this is 2 it means the current navigation is navigations[2].
  optional int32 current_navigation_index = 4 [default = -1];
  // True if the tab is pinned.
  optional bool pinned = 5 [default = false];
  // If non-empty, this tab is an app tab and this is the id of the extension.
  optional string extension_app_id = 6;
  // Tabs are navigated, and the navigation data is here.
  repeated TabNavigation navigation = 7;
}
message TabNavigation {
  // The index in the NavigationController. If this is -1, it means this
  // TabNavigation is bogus.
  optional int32 index = 1 [default = -1];
  // The virtual URL, when nonempty, will override the actual URL of the page
  // when we display it to the user.
  optional string virtual_url = 2;
  // The referring URL, which can be empty.
  optional string referrer = 3;
  // The title of the page.
  optional string title = 4;
  // Content state is an opaque blob created by WebKit that represents the
  // state of the page. This includes form entries and scroll position for each
  // frame.
  optional string state = 5;
  // Types of transitions between pages.
  enum PageTransition {
    LINK = 0;
    TYPED = 1;
    AUTO_BOOKMARK = 2;
    AUTO_SUBFRAME = 3;
    MANUAL_SUBFRAME = 4;
    GENERATED = 5;
    START_PAGE = 6;
    FORM_SUBMIT = 7;
    RELOAD = 8;
    KEYWORD = 9;
    KEYWORD_GENERATED = 10;
    CHAIN_START = 12;
    CHAIN_END = 13;
  }
  // These qualifiers further define the transition.
  enum PageTransitionQualifier {
    CLIENT_REDIRECT = 1;
    SERVER_REDIRECT = 2;
  }
  optional PageTransition page_transition = 6 [default = TYPED];
  optional PageTransitionQualifier navigation_qualifier = 7;
}