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 3 // found in the LICENSE file. 4 // 5 // Sync protocol datatype extension for sessions. 6 7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change 8 // any fields in this file. 9 10 syntax = "proto2"; 11 12 option optimize_for = LITE_RUNTIME; 13 option retain_unknown_fields = true; 14 15 package sync_pb; 16 17 import "sync.proto"; 18 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; 24 } 25 // Properties of session sync objects. 26 message SessionHeader { 27 // Each session is composed of windows. 28 repeated SessionWindow window = 2; 29 } 30 message SessionWindow { 31 // Unique (to the owner) id for this window. 32 optional int32 window_id = 1; 33 // Index of the selected tab in tabs; -1 if no tab is selected. 34 optional int32 selected_tab_index = 2 [default = -1]; 35 // Type of the browser. Currently we only store browsers of type 36 // TYPE_NORMAL and TYPE_POPUP. 37 enum BrowserType { 38 TYPE_NORMAL = 1; 39 TYPE_POPUP = 2; 40 } 41 optional BrowserType browser_type = 3 [default = TYPE_NORMAL]; 42 // The tabs that compose a window (correspond to tab id's). 43 repeated int32 tab = 4; 44 } 45 message SessionTab { 46 // Unique (to the owner) id for this tab. 47 optional int32 tab_id = 1; 48 // The unique id for the window this tab belongs to. 49 optional int32 window_id = 2; 50 // Visual index of the tab within its window. There may be gaps in these 51 // values. 52 optional int32 tab_visual_index = 3 [default = -1]; 53 // Identifies the index of the current navigation in navigations. For 54 // example, if this is 2 it means the current navigation is navigations[2]. 55 optional int32 current_navigation_index = 4 [default = -1]; 56 // True if the tab is pinned. 57 optional bool pinned = 5 [default = false]; 58 // If non-empty, this tab is an app tab and this is the id of the extension. 59 optional string extension_app_id = 6; 60 // Tabs are navigated, and the navigation data is here. 61 repeated TabNavigation navigation = 7; 62 } 63 message TabNavigation { 64 // The index in the NavigationController. If this is -1, it means this 65 // TabNavigation is bogus. 66 optional int32 index = 1 [default = -1]; 67 // The virtual URL, when nonempty, will override the actual URL of the page 68 // when we display it to the user. 69 optional string virtual_url = 2; 70 // The referring URL, which can be empty. 71 optional string referrer = 3; 72 // The title of the page. 73 optional string title = 4; 74 // Content state is an opaque blob created by WebKit that represents the 75 // state of the page. This includes form entries and scroll position for each 76 // frame. 77 optional string state = 5; 78 // Types of transitions between pages. 79 enum PageTransition { 80 LINK = 0; 81 TYPED = 1; 82 AUTO_BOOKMARK = 2; 83 AUTO_SUBFRAME = 3; 84 MANUAL_SUBFRAME = 4; 85 GENERATED = 5; 86 START_PAGE = 6; 87 FORM_SUBMIT = 7; 88 RELOAD = 8; 89 KEYWORD = 9; 90 KEYWORD_GENERATED = 10; 91 CHAIN_START = 12; 92 CHAIN_END = 13; 93 } 94 // These qualifiers further define the transition. 95 enum PageTransitionQualifier { 96 CLIENT_REDIRECT = 1; 97 SERVER_REDIRECT = 2; 98 } 99 optional PageTransition page_transition = 6 [default = TYPED]; 100 optional PageTransitionQualifier navigation_qualifier = 7; 101 } 102 103 extend EntitySpecifics { 104 optional SessionSpecifics session = 50119; 105 } 106