Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: chrome/common/extensions/api/sessions.json

Issue 21022018: Sessions API - previously Session Restore API. Supports restoring currently open foreign windows an… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Set similarity Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 [ 5 [
6 { 6 {
7 "namespace": "sessionRestore", 7 "namespace": "sessions",
8 "description": "Use the <code>chrome.sessionRestore</code> API to query and restore tabs and windows from a browsing session.", 8 "description": "Use the <code>chrome.sessions</code> API to query and restor e tabs and windows from a browsing session.",
9 "types": [ 9 "types": [
10 { 10 {
11 "id": "ClosedEntry", 11 "id": "Session",
12 "type": "object", 12 "type": "object",
13 "properties": { 13 "properties": {
14 "id": {"type": "integer", "minimum": 0, "description": "The ID of the browser session."}, 14 "lastModified": {"type": "integer", "description": "The time when the window or tab was closed, represented in milliseconds since the epoch"},
15 "timestamp": {"type": "integer", "description": "The time when the win dow or tab was closed, represented in milliseconds since the epoch"}, 15 "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The clos ed $ref:tabs.Tab, if this entry describes a tab. Either this or $ref:Session.win dow will be set."},
16 "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The clos ed $ref:tabs.Tab, if this entry describes a tab. Either this or $ref:ClosedEntry .window will be set."}, 16 "window": {"$ref": "windows.Window", "optional": true, "description": "The closed $ref:windows.Window, if this entry describes a window. Either this o r $ref:Session.tab will be set."}
17 "window": {"$ref": "windows.Window", "optional": true, "description": "The closed $ref:windows.Window, if this entry describes a window. Either this o r $ref:ClosedEntry.tab will be set."} 17 }
18 },
19 {
20 "id": "Device",
21 "type": "object",
not at google - send to devlin 2013/08/06 19:04:09 description here should include that this represen
Kristen Dwan 2013/08/12 15:11:30 Done.
22 "properties": {
23 "info": {"type": "string", "description": "Represents all information about device."},
not at google - send to devlin 2013/08/06 19:04:09 A string represents all information about the devi
Kristen Dwan 2013/08/12 15:11:30 Yeah (this is just a temp placeholder) - it will b
24 "sessions": {"type": "array", "items": {"$ref": "Session"}, "descripti on": "Each session represents a window and its currently open tabs on said devic e. The array will comprise of all window entries currently open on related devic e."}
not at google - send to devlin 2013/08/06 19:04:09 A list of open window sessions for the [adjective]
Kristen Dwan 2013/08/12 15:11:30 Done.
18 } 25 }
19 } 26 }
20 ], 27 ],
21 "functions": [ 28 "functions": [
22 { 29 {
23 "name": "getRecentlyClosed", 30 "name": "getRecentlyClosed",
24 "type": "function", 31 "type": "function",
25 "description": "Gets the list of recently closed tabs and/or windows.", 32 "description": "Gets the list of recently closed tabs and/or windows.",
26 "parameters": [ 33 "parameters": [
27 { 34 {
(...skipping 14 matching lines...) Expand all
42 "optional": true, 49 "optional": true,
43 "description": "The type of entry to fetch. Omit to fetch all ty pes of entries." 50 "description": "The type of entry to fetch. Omit to fetch all ty pes of entries."
44 } 51 }
45 } 52 }
46 }, 53 },
47 { 54 {
48 "type": "function", 55 "type": "function",
49 "name": "callback", 56 "name": "callback",
50 "parameters": [ 57 "parameters": [
51 { 58 {
52 "name": "entries", "type": "array", "items": { "$ref": "ClosedEn try" }, "description": "The list of closed entries in reverse order that they we re closed (the most recently closed tab or window will be at index <code>0</code >). If <code>entryType</code> is specified the entries will be only of that type , otherwise the entries may contain either tabs or windows.List of $ref:ClosedEn try representing the closed tab/window for the session." 59 "name": "sessions", "type": "array", "items": { "$ref": "Session " }, "description": "The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index <code>0</code>). If <code>entryType</code> is specified the entries will be only of that type, o therwise the entries may contain either tabs or windows.List of $ref:Session rep resenting the closed tab/window for the session."
53 } 60 }
54 ] 61 ]
55 } 62 }
63 ]
64 },
65 {
66 "name": "getDevices",
67 "type": "function",
68 "description": "Retrieves all synced sessions and returns in sorted orde r from device with most recently modified session to device with least recently modified session, and within each device by most recent to least recently modifi ed session.",
69 "parameters": [
70 {
71 "name": "maxResults",
72 "type": "integer",
73 "optional": true,
74 "minimum": 0,
75 "maximum": 10
not at google - send to devlin 2013/08/06 19:04:09 make this first parameter an object with argument
Kristen Dwan 2013/08/12 15:11:30 Done.
76 },
77 {
78 "type": "function",
79 "name": "callback",
80 "parameters": [
81 {
82 "name": "devices", "type": "array", "items": { "$ref": "Device" }, "description": "The list of $ref:Device objects for each synced session, sort ed in order from device with most recently modified session to device with least recently modified session, and within each device by most recent to least recen tly modified session."
not at google - send to devlin 2013/08/06 19:04:09 "and within each device..." that documentation sho
Kristen Dwan 2013/08/12 15:11:30 Done.
83 }
84 ]
85 }
56 ] 86 ]
57 }, 87 },
58 { 88 {
59 "name": "restore", 89 "name": "restore",
60 "type": "function", 90 "type": "function",
61 "description": "Reopens a $ref:ClosedEntry, with an optional callback to run when the entry has been restored.", 91 "description": "Reopens a $ref:Session, $ref:windows.Window, or $ref:tab s.Tab, with an optional callback to run when the entry has been restored.",
62 "parameters": [ 92 "parameters": [
63 {"type": "integer", "name": "id", "optional": true, "description": "Th e id of the $ref:ClosedEntry to restore."}, 93 {
64 {"type": "function", "name": "callback", "optional": true, "parameters ": []} 94 "type": "string",
95 "name": "sessionId",
96 "optional": true,
97 "description": "The API provided $ref:windows.Window.sessionId, or $ ref:tabs.Tab.sessionId to restore."
not at google - send to devlin 2013/08/06 19:04:09 "The API provided" sounds awkward.
Kristen Dwan 2013/08/12 15:11:30 Done.
98 },
99 {
100 "type": "function",
101 "name": "callback",
102 "optional": true,
103 "parameters": [
104 {
105 "choices": [{"$ref": "windows.Window"}, {"$ref": "tabs.Tab"}],
106 "name": "restoredSession",
107 "description": "The restored $ref:windows.Window or $ref:tabs.Ta b object."
not at google - send to devlin 2013/08/06 19:04:09 I wonder whether this should actually be an object
Kristen Dwan 2013/08/12 15:11:30 Done.
108 }
109 ]
110 }
65 ] 111 ]
66 } 112 }
67 ] 113 ]
68 } 114 }
69 ] 115 ]
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698