OLD | NEW |
---|---|
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": "Filter", |
12 "type": "object", | 12 "type": "object", |
13 "properties": { | 13 "properties": { |
14 "id": {"type": "integer", "minimum": 0, "description": "The ID of the browser session."}, | 14 "maxResults": { |
15 "timestamp": {"type": "integer", "description": "The time when the win dow or tab was closed, represented in milliseconds since the epoch"}, | 15 "type": "integer", |
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 "minimum": 0, |
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 "maximum": 25, |
18 "optional": true, | |
19 "description": "The maximum number of entries to be fetched in the r equested list. Omit this parameter to fetch the maximum number of entries (25)." | |
20 }, | |
21 "entryType": { | |
22 "type": "string", | |
23 "enum": ["tab", "window"], | |
24 "optional": true, | |
25 "description": "The type of entry to fetch. Omit this parameter to f etch all types of entries. Note: All $ref:Device.sessions entries will be window s regardless of this value." | |
not at google - send to devlin
2013/08/19 19:34:40
It's conceivable to me that one day we'll allow re
Kristen Dwan
2013/08/19 21:35:05
you already can restore an individual tab from a s
| |
26 } | |
27 } | |
28 }, | |
dharcourt
2013/08/19 17:53:12
FWIW, there are trailing spaces on this line (28)
Kristen Dwan
2013/08/19 21:35:05
Done.
| |
29 { | |
30 "id": "Session", | |
31 "type": "object", | |
32 "properties": { | |
33 "lastModified": {"type": "integer", "description": "The time when the window or tab was closed, represented in milliseconds since the epoch"}, | |
34 "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."}, | |
35 "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."} | |
36 } | |
37 }, | |
38 { | |
39 "id": "Device", | |
40 "type": "object", | |
41 "properties": { | |
42 "info": {"type": "string", "description": "Represents all information about a foreign device."}, | |
43 "sessions": {"type": "array", "items": {"$ref": "Session"}, "descripti on": "A list of open window sessions for the foreign device, sorted from most re cently to least recently modified session."} | |
18 } | 44 } |
19 } | 45 } |
20 ], | 46 ], |
21 "functions": [ | 47 "functions": [ |
22 { | 48 { |
23 "name": "getRecentlyClosed", | 49 "name": "getRecentlyClosed", |
24 "type": "function", | 50 "type": "function", |
25 "description": "Gets the list of recently closed tabs and/or windows.", | 51 "description": "Gets the list of recently closed tabs and/or windows.", |
26 "parameters": [ | 52 "parameters": [ |
27 { | 53 { |
28 "type": "object", | 54 "$ref": "Filter", |
29 "name": "options", | 55 "name": "options", |
dharcourt
2013/08/19 17:53:12
Nit: "options" -> "filter"?
not at google - send to devlin
2013/08/19 19:34:40
I think that would result in slightly nicer genera
Kristen Dwan
2013/08/19 21:35:05
Done.
| |
30 "optional": true, | 56 "optional": true |
31 "properties": { | |
32 "maxResults": { | |
33 "type": "integer", | |
34 "minimum": 0, | |
35 "maximum": 25, | |
36 "optional": true, | |
37 "description": "The maximum number of entries to be fetched in t he requested list. Omit to fetch the maximum number of entries (25)." | |
38 }, | |
39 "entryType": { | |
40 "type": "string", | |
41 "enum": ["tab", "window"], | |
42 "optional": true, | |
43 "description": "The type of entry to fetch. Omit to fetch all ty pes of entries." | |
44 } | |
45 } | |
46 }, | 57 }, |
47 { | 58 { |
48 "type": "function", | 59 "type": "function", |
49 "name": "callback", | 60 "name": "callback", |
50 "parameters": [ | 61 "parameters": [ |
51 { | 62 { |
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." | 63 "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." |
53 } | 64 } |
54 ] | 65 ] |
55 } | 66 } |
67 ] | |
68 }, | |
69 { | |
70 "name": "getDevices", | |
71 "type": "function", | |
72 "description": "Retrieves all devices with synced sessions.", | |
73 "parameters": [ | |
74 { | |
75 "$ref": "Filter", | |
76 "name": "options", | |
dharcourt
2013/08/19 17:53:12
Nit: "options" -> "filter"?
Kristen Dwan
2013/08/19 21:35:05
Done.
| |
77 "optional": true, | |
78 "description": "$ref:Filter.entryType is not taken into consideratio n. Results will always be returned as $ref:Session.window." | |
79 }, | |
80 { | |
81 "type": "function", | |
82 "name": "callback", | |
83 "parameters": [ | |
84 { | |
85 "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. $ref:tabs.Tab objects are sorted by recency in the $ ref:windows.Window of the $ref:Session objects." | |
86 } | |
87 ] | |
88 } | |
56 ] | 89 ] |
57 }, | 90 }, |
58 { | 91 { |
59 "name": "restore", | 92 "name": "restore", |
60 "type": "function", | 93 "type": "function", |
61 "description": "Reopens a $ref:ClosedEntry, with an optional callback to run when the entry has been restored.", | 94 "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": [ | 95 "parameters": [ |
63 {"type": "integer", "name": "id", "optional": true, "description": "Th e id of the $ref:ClosedEntry to restore."}, | 96 { |
64 {"type": "function", "name": "callback", "optional": true, "parameters ": []} | 97 "type": "string", |
98 "name": "sessionId", | |
99 "optional": true, | |
100 "description": "The $ref:windows.Window.sessionId, or $ref:tabs.Tab. sessionId to restore." | |
101 }, | |
102 { | |
103 "type": "function", | |
104 "name": "callback", | |
105 "optional": true, | |
106 "parameters": [ | |
107 { | |
108 "$ref": "Session", | |
109 "name": "restoredSession", | |
110 "description": "A $ref:Session containing the restored $ref:wind ows.Window or $ref:tabs.Tab object." | |
111 } | |
112 ] | |
113 } | |
65 ] | 114 ] |
66 } | 115 } |
67 ] | 116 ] |
68 } | 117 } |
69 ] | 118 ] |
OLD | NEW |