session_specifics.proto 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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.
  4. //
  5. // Sync protocol datatype extension for sessions.
  6. // If you change or add any fields in this file, update proto_visitors.h and
  7. // potentially proto_enum_conversions.{h, cc}.
  8. syntax = "proto2";
  9. option java_multiple_files = true;
  10. option java_package = "org.chromium.components.sync.protocol";
  11. option optimize_for = LITE_RUNTIME;
  12. package sync_pb;
  13. import "components/sync/protocol/sync_enums.proto";
  14. message SessionSpecifics {
  15. // Unique id for the client. M89 and higher use sync's cache GUID (client ID)
  16. // to populate this tag for *new* sessions.
  17. optional string session_tag = 1;
  18. optional SessionHeader header = 2;
  19. optional SessionTab tab = 3;
  20. // The local tab id used by sync. Unique across all nodes for that client.
  21. optional int32 tab_node_id = 4 [default = -1];
  22. }
  23. // Properties of session sync objects.
  24. message SessionHeader {
  25. // Each session is composed of windows.
  26. repeated SessionWindow window = 2;
  27. // A non-unique but human-readable name to describe this client.
  28. optional string client_name = 3;
  29. // The type of device.
  30. optional SyncEnums.DeviceType device_type = 4;
  31. }
  32. message SessionWindow {
  33. // Unique (to the owner) id for this window.
  34. optional int32 window_id = 1;
  35. // Index of the selected tab in tabs; -1 if no tab is selected.
  36. optional int32 selected_tab_index = 2 [default = -1];
  37. // Type of the window.
  38. optional SyncEnums.BrowserType browser_type = 3 [default = TYPE_TABBED];
  39. // The tabs that compose a window (correspond to tab id's).
  40. repeated int32 tab = 4;
  41. }
  42. message SessionTab {
  43. // Unique (to the owner) id for this tab.
  44. optional int32 tab_id = 1 [default = -1];
  45. // The unique id for the window this tab belongs to.
  46. optional int32 window_id = 2;
  47. // Visual index of the tab within its window. There may be gaps in these
  48. // values.
  49. optional int32 tab_visual_index = 3 [default = -1];
  50. // Identifies the index of the current navigation in navigations. For
  51. // example, if this is 2 it means the current navigation is navigations[2].
  52. optional int32 current_navigation_index = 4 [default = -1];
  53. // True if the tab is pinned.
  54. optional bool pinned = 5 [default = false];
  55. // If non-empty, this tab is an app tab and this is the id of the extension.
  56. optional string extension_app_id = 6;
  57. // Tabs are navigated, and the navigation data is here.
  58. repeated TabNavigation navigation = 7;
  59. // The favicon for the current url the tab is displaying. Either empty
  60. // or a valid PNG encoded favicon.
  61. optional bytes favicon = 8 [deprecated = true];
  62. // The type of favicon. For now only normal web favicons are supported.
  63. enum FaviconType { TYPE_WEB_FAVICON = 1; }
  64. optional FaviconType favicon_type = 9 [deprecated = true];
  65. // The url of the actual favicon (as opposed to the page using the favicon).
  66. optional string favicon_source = 11 [deprecated = true];
  67. // Ids of the currently assigned variations which should be sent to sync.
  68. repeated uint64 variation_id = 12 [deprecated = true];
  69. optional SyncEnums.BrowserType browser_type = 13;
  70. }
  71. message TabNavigation {
  72. // The index in the NavigationController. If this is -1, it means this
  73. // TabNavigation is bogus.
  74. // optional int32 index = 1 [default = -1]; // obsolete.
  75. // The virtual URL, when nonempty, will override the actual URL of the page
  76. // when we display it to the user.
  77. optional string virtual_url = 2;
  78. // The referring URL, which can be empty.
  79. optional string referrer = 3;
  80. // The title of the page.
  81. optional string title = 4;
  82. // Content state is an opaque blob created by WebKit that represents the
  83. // state of the page. This includes form entries and scroll position for each
  84. // frame.
  85. // optional string state = 5; // obsolete.
  86. // The core transition type.
  87. optional SyncEnums.PageTransition page_transition = 6 [default = LINK];
  88. // If this transition was triggered by a redirect, the redirect type.
  89. optional SyncEnums.PageTransitionRedirectType redirect_type = 7;
  90. // The unique navigation id (within this client).
  91. optional int32 unique_id = 8;
  92. // Timestamp for when this navigation last occurred (in client time).
  93. // If the user goes back/forward in history the timestamp may refresh.
  94. optional int64 timestamp_msec = 9;
  95. // User used the Forward or Back button to navigate among browsing history.
  96. optional bool navigation_forward_back = 10;
  97. // User used the address bar to trigger this navigation.
  98. optional bool navigation_from_address_bar = 11;
  99. // User is navigating to the home page.
  100. optional bool navigation_home_page = 12;
  101. // The beginning of a navigation chain.
  102. optional bool navigation_chain_start = 13;
  103. // The last transition in a redirect chain.
  104. optional bool navigation_chain_end = 14;
  105. // The id for this navigation, which is globally unique with high
  106. // probability.
  107. optional int64 global_id = 15;
  108. // Search terms extracted from the URL.
  109. optional string search_terms = 16 [deprecated = true];
  110. // The favicon url associated with this page.
  111. optional string favicon_url = 17;
  112. enum BlockedState {
  113. STATE_ALLOWED = 1;
  114. STATE_BLOCKED = 2;
  115. }
  116. // Whether access to the URL was allowed or blocked.
  117. optional BlockedState blocked_state = 18 [default = STATE_ALLOWED];
  118. reserved 19;
  119. reserved "content_pack_categories";
  120. // The status code from the last navigation.
  121. optional int32 http_status_code = 20;
  122. // Referrer policy. Old, broken value. Deprecated in M61.
  123. optional int32 obsolete_referrer_policy = 21 [deprecated = true];
  124. // True if created from restored navigation entry that hasn't been loaded.
  125. optional bool is_restored = 22;
  126. // The chain of redirections for this navigation, from the original URL
  127. // through the last URL that redirected.
  128. repeated NavigationRedirect navigation_redirect = 23;
  129. // Normally not present.
  130. // The last URL traversed when different from the virtual_url.
  131. optional string last_navigation_redirect_url = 24;
  132. // Correct referrer policy. Valid enums are defined in
  133. // third_party/WebKit/public/platform/WebReferrerPolicy.h.
  134. optional int32 correct_referrer_policy = 25 [default = 1];
  135. // Whether the Password Manager saw a password field on the page.
  136. optional SyncEnums.PasswordState password_state = 26;
  137. // The id for the task associated with this navigation, which is globally
  138. // unique with high probability.
  139. // Similar with global_id, but used to identify a navigation in Chrome Tasks,
  140. // so navigations of a page have the same task_id if one is the first visit of
  141. // the page, and others are its back/forward visits.
  142. optional int64 task_id = 27;
  143. // Task ids of all ancestor navigations, which can be from other tabs, from
  144. // root to parent. We define navigation A is parent of navigation B if page of
  145. // B is got by clicking a link on page of A. This relationship is used to
  146. // define a Chrome Task as a tree rooted by a navigation.
  147. repeated int64 ancestor_task_id = 28;
  148. // When a history entry is replaced (e.g. history.replaceState()), this
  149. // contains some information about the entry prior to being replaced. Even if
  150. // an entry is replaced multiple times, it represents data prior to the
  151. // *first* replace.
  152. optional ReplacedNavigation replaced_navigation = 29;
  153. // The page language as determined by its textual content. An ISO 639 language
  154. // code (two letters, except for Chinese where a localization is necessary).
  155. optional string page_language = 30;
  156. }
  157. // Navigation information for a single redirection within a single navigation.
  158. message NavigationRedirect {
  159. // A URL that redirected while navigating to the virtual_url.
  160. optional string url = 1;
  161. }
  162. // Subset of TabNavigation fields representing a navigation that was later
  163. // replaced in history (e.g. history.replaceState()), which allows tracking
  164. // information about the original navigation prior to the first replacement.
  165. message ReplacedNavigation {
  166. optional string first_committed_url = 1;
  167. optional int64 first_timestamp_msec = 2;
  168. optional SyncEnums.PageTransition first_page_transition = 3;
  169. }