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