1 // Copyright (c) 2012 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.
5 // Sync protocol datatype extension for sessions.
7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
8 // any fields in this file.
12 option optimize_for = LITE_RUNTIME;
13 option retain_unknown_fields = true;
17 import "sync_enums.proto";
19 message SessionSpecifics {
20 // Unique id for the client.
21 optional string session_tag = 1;
22 optional SessionHeader header = 2;
23 optional SessionTab tab = 3;
25 // The local tab id used by sync. Unique across all nodes for that client.
26 optional int32 tab_node_id = 4 [default = -1];
29 // Properties of session sync objects.
30 message SessionHeader {
31 // Each session is composed of windows.
32 repeated SessionWindow window = 2;
33 // A non-unique but human-readable name to describe this client.
34 optional string client_name = 3;
35 // The type of device.
36 optional SyncEnums.DeviceType device_type = 4;
39 message SessionWindow {
40 // Unique (to the owner) id for this window.
41 optional int32 window_id = 1;
42 // Index of the selected tab in tabs; -1 if no tab is selected.
43 optional int32 selected_tab_index = 2 [default = -1];
44 // Type of the browser. Currently we only store browsers of type
45 // TYPE_TABBED and TYPE_POPUP.
50 optional BrowserType browser_type = 3 [default = TYPE_TABBED];
51 // The tabs that compose a window (correspond to tab id's).
52 repeated int32 tab = 4;
56 // Unique (to the owner) id for this tab.
57 optional int32 tab_id = 1;
58 // The unique id for the window this tab belongs to.
59 optional int32 window_id = 2;
60 // Visual index of the tab within its window. There may be gaps in these
62 optional int32 tab_visual_index = 3 [default = -1];
63 // Identifies the index of the current navigation in navigations. For
64 // example, if this is 2 it means the current navigation is navigations[2].
65 optional int32 current_navigation_index = 4 [default = -1];
66 // True if the tab is pinned.
67 optional bool pinned = 5 [default = false];
68 // If non-empty, this tab is an app tab and this is the id of the extension.
69 optional string extension_app_id = 6;
70 // Tabs are navigated, and the navigation data is here.
71 repeated TabNavigation navigation = 7;
73 // Fields 8 through 11 are deprecated.
74 // The favicon for the current url the tab is displaying. Either empty
75 // or a valid PNG encoded favicon.
76 optional bytes favicon = 8;
77 // The type of favicon. For now only normal web favicons are supported.
81 optional FaviconType favicon_type = 9;
82 // The url of the actual favicon (as opposed to the page using the favicon).
83 optional string favicon_source = 11;
86 message TabNavigation {
87 // The index in the NavigationController. If this is -1, it means this
88 // TabNavigation is bogus.
89 // optional int32 index = 1 [default = -1]; // obsolete.
90 // The virtual URL, when nonempty, will override the actual URL of the page
91 // when we display it to the user.
92 optional string virtual_url = 2;
93 // The referring URL, which can be empty.
94 optional string referrer = 3;
95 // The title of the page.
96 optional string title = 4;
97 // Content state is an opaque blob created by WebKit that represents the
98 // state of the page. This includes form entries and scroll position for each
100 optional string state = 5;
101 // The core transition type.
102 optional SyncEnums.PageTransition page_transition = 6 [default = TYPED];
103 // If this transition was triggered by a redirect, the redirect type.
104 optional SyncEnums.PageTransitionRedirectType redirect_type = 7;
105 // The unique navigation id (within this client).
106 optional int32 unique_id = 8;
107 // Timestamp for when this navigation last occurred (in client time).
108 // If the user goes back/foward in history the timestamp may refresh.
109 optional int64 timestamp_msec = 9;
110 // User used the Forward or Back button to navigate among browsing history.
111 optional bool navigation_forward_back = 10;
112 // User used the address bar to trigger this navigation.
113 optional bool navigation_from_address_bar = 11;
114 // User is navigating to the home page.
115 optional bool navigation_home_page = 12;
116 // The beginning of a navigation chain.
117 optional bool navigation_chain_start = 13;
118 // The last transition in a redirect chain.
119 optional bool navigation_chain_end = 14;
120 // The id for this navigation, which is globally unique with high
122 optional int64 global_id = 15;
123 // Search terms extracted from the URL.
124 optional string search_terms = 16;
125 // The favicon url associated with this page.
126 optional string favicon_url = 17;
131 // Whether access to the URL was allowed or blocked.
132 optional BlockedState blocked_state = 18 [default=STATE_ALLOWED];
133 // A list of category identifiers for the URL.
134 repeated string content_pack_categories = 19;
135 // The status code from the last navigation.
136 optional int32 http_status_code = 20;