Home | History | Annotate | Download | only in protocol
      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 
      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_enums.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   // The local tab id used by sync. Unique across all nodes for that client.
     26   optional int32 tab_node_id = 4 [default = -1];
     27 }
     28 
     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;
     37 }
     38 
     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.
     46   enum BrowserType {
     47     TYPE_TABBED = 1;
     48     TYPE_POPUP = 2;
     49   }
     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;
     53 }
     54 
     55 message SessionTab {
     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
     61   // values.
     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;
     72 
     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.
     78   enum FaviconType {
     79     TYPE_WEB_FAVICON = 1;
     80   }
     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;
     84 }
     85 
     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
     99   // frame.
    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
    121   // probability.
    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;
    127   enum BlockedState {
    128     STATE_ALLOWED = 1;
    129     STATE_BLOCKED = 2;
    130   }
    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;
    137 }
    138