| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Sync protocol datatype extension for sessions. | 5 // Sync protocol datatype extension for sessions. |
| 6 | 6 |
| 7 syntax = "proto2"; | 7 syntax = "proto2"; |
| 8 | 8 |
| 9 option optimize_for = LITE_RUNTIME; | 9 option optimize_for = LITE_RUNTIME; |
| 10 option retain_unknown_fields = true; | 10 option retain_unknown_fields = true; |
| 11 | 11 |
| 12 package sync_pb; | 12 package sync_pb; |
| 13 | 13 |
| 14 import "sync.proto"; | 14 import "sync.proto"; |
| 15 | 15 |
| 16 message SessionSpecifics { |
| 17 // Unique id for the client. |
| 18 optional string session_tag = 1; |
| 19 optional SessionHeader header = 2; |
| 20 optional SessionTab tab = 3; |
| 21 } |
| 16 // Properties of session sync objects. | 22 // Properties of session sync objects. |
| 17 message SessionSpecifics { | 23 message SessionHeader { |
| 18 // Unique id for the session. | |
| 19 optional string session_tag = 1; | |
| 20 // Each session is composed of windows. | 24 // Each session is composed of windows. |
| 21 repeated SessionWindow session_window = 2; | 25 repeated SessionWindow window = 2; |
| 22 } | 26 } |
| 23 message SessionWindow { | 27 message SessionWindow { |
| 28 // Unique (to the owner) id for this window. |
| 29 optional int32 window_id = 1; |
| 24 // Index of the selected tab in tabs; -1 if no tab is selected. | 30 // Index of the selected tab in tabs; -1 if no tab is selected. |
| 25 optional int32 selected_tab_index = 2 [default = -1]; | 31 optional int32 selected_tab_index = 2 [default = -1]; |
| 26 // Type of the browser. Currently we only store browsers of type | 32 // Type of the browser. Currently we only store browsers of type |
| 27 // TYPE_NORMAL and TYPE_POPUP. | 33 // TYPE_NORMAL and TYPE_POPUP. |
| 28 enum BrowserType { | 34 enum BrowserType { |
| 29 TYPE_NORMAL = 1; | 35 TYPE_NORMAL = 1; |
| 30 TYPE_POPUP = 2; | 36 TYPE_POPUP = 2; |
| 31 } | 37 } |
| 32 optional BrowserType browser_type = 3 [default = TYPE_NORMAL]; | 38 optional BrowserType browser_type = 3 [default = TYPE_NORMAL]; |
| 33 // The tabs that compose a window. | 39 // The tabs that compose a window (correspond to tab id's). |
| 34 repeated SessionTab session_tab= 4; | 40 repeated int32 tab = 4; |
| 35 } | 41 } |
| 36 message SessionTab { | 42 message SessionTab { |
| 43 // Unique (to the owner) id for this tab. |
| 44 optional int32 tab_id = 1; |
| 45 // The unique id for the window this tab belongs to. |
| 46 optional int32 window_id = 2; |
| 37 // Visual index of the tab within its window. There may be gaps in these | 47 // Visual index of the tab within its window. There may be gaps in these |
| 38 // values. | 48 // values. |
| 39 optional int32 tab_visual_index = 2 [default = -1]; | 49 optional int32 tab_visual_index = 3 [default = -1]; |
| 40 // Identifies the index of the current navigation in navigations. For | 50 // Identifies the index of the current navigation in navigations. For |
| 41 // example, if this is 2 it means the current navigation is navigations[2]. | 51 // example, if this is 2 it means the current navigation is navigations[2]. |
| 42 optional int32 current_navigation_index = 3 [default = -1]; | 52 optional int32 current_navigation_index = 4 [default = -1]; |
| 43 // True if the tab is pinned. | 53 // True if the tab is pinned. |
| 44 optional bool pinned = 4 [default = false]; | 54 optional bool pinned = 5 [default = false]; |
| 45 // If non-empty, this tab is an app tab and this is the id of the extension. | 55 // If non-empty, this tab is an app tab and this is the id of the extension. |
| 46 optional string extension_app_id = 5; | 56 optional string extension_app_id = 6; |
| 47 // Tabs are navigated, and the navigation data is here. | 57 // Tabs are navigated, and the navigation data is here. |
| 48 repeated TabNavigation navigation = 6; | 58 repeated TabNavigation navigation = 7; |
| 49 } | 59 } |
| 50 message TabNavigation { | 60 message TabNavigation { |
| 51 // The index in the NavigationController. If this is -1, it means this | 61 // The index in the NavigationController. If this is -1, it means this |
| 52 // TabNavigation is bogus. | 62 // TabNavigation is bogus. |
| 53 optional int32 index = 1 [default = -1]; | 63 optional int32 index = 1 [default = -1]; |
| 54 // The virtual URL, when nonempty, will override the actual URL of the page | 64 // The virtual URL, when nonempty, will override the actual URL of the page |
| 55 // when we display it to the user. | 65 // when we display it to the user. |
| 56 optional string virtual_url = 2; | 66 optional string virtual_url = 2; |
| 57 // The referring URL, which can be empty. | 67 // The referring URL, which can be empty. |
| 58 optional string referrer = 3; | 68 optional string referrer = 3; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 83 CLIENT_REDIRECT = 1; | 93 CLIENT_REDIRECT = 1; |
| 84 SERVER_REDIRECT = 2; | 94 SERVER_REDIRECT = 2; |
| 85 } | 95 } |
| 86 optional PageTransition page_transition = 6 [default = TYPED]; | 96 optional PageTransition page_transition = 6 [default = TYPED]; |
| 87 optional PageTransitionQualifier navigation_qualifier = 7; | 97 optional PageTransitionQualifier navigation_qualifier = 7; |
| 88 } | 98 } |
| 89 | 99 |
| 90 extend EntitySpecifics { | 100 extend EntitySpecifics { |
| 91 optional SessionSpecifics session = 50119; | 101 optional SessionSpecifics session = 50119; |
| 92 } | 102 } |
| OLD | NEW |