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

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: sync 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": "permissions", 7 "namespace": "sessions",
not at google - send to devlin 2013/08/20 16:43:32 ok, looks like git has decided that this is a move
8 "description": "Use the <code>chrome.permissions</code> API to request <a hr ef=\"#manifest\">declared optional permissions</a> at run time rather than insta ll time, so users understand why the permissions are needed and grant only those that are necessary.", 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": "Permissions", 11 "id": "Filter",
12 "type": "object", 12 "type": "object",
13 "properties": { 13 "properties": {
14 "permissions": { 14 "maxResults": {
15 "type": "array", 15 "type": "integer",
16 "items": {"type": "string"}, 16 "minimum": 0,
17 "maximum": 25,
17 "optional": true, 18 "optional": true,
18 "description": "List of named permissions (does not include hosts or origins)." 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 ($ref: MAX_SESSION_RESULTS)."
19 },
20 "origins": {
21 "type": "array",
22 "items": {"type": "string"},
23 "optional": true,
24 "description": "List of origin permissions."
25 } 20 }
26 } 21 }
22 },
23 {
24 "id": "Session",
25 "type": "object",
26 "properties": {
27 "lastModified": {"type": "integer", "description": "The time when the window or tab was closed, represented in milliseconds since the epoch"},
28 "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."},
29 "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."}
30 }
31 },
32 {
33 "id": "Device",
34 "type": "object",
35 "properties": {
36 "info": {"type": "string", "description": "Represents all information about a foreign device."},
37 "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."}
38 }
27 } 39 }
28 ], 40 ],
29 "events": [ 41 "functions": [
30 { 42 {
31 "name": "onAdded", 43 "name": "getRecentlyClosed",
32 "type": "function", 44 "type": "function",
33 "description": "Fired when the extension acquires new permissions.", 45 "description": "Gets the list of recently closed tabs and/or windows.",
34 "parameters": [ 46 "parameters": [
35 { 47 {
36 "$ref": "Permissions", 48 "$ref": "Filter",
37 "name": "permissions", 49 "name": "filter",
38 "description": "The newly acquired permissions." 50 "optional": true
39 } 51 },
40 ]
41 },
42 {
43 "name": "onRemoved",
44 "type": "function",
45 "description": "Fired when access to permissions has been removed from t he extension.",
46 "parameters": [
47 { 52 {
48 "$ref": "Permissions", 53 "type": "function",
49 "name": "permissions",
50 "description": "The permissions that have been removed."
51 }
52 ]
53 }
54 ],
55 "functions": [
56 {
57 "name": "getAll",
58 "type": "function",
59 "description": "Gets the extension's current set of permissions.",
60 "parameters": [
61 {
62 "name": "callback", 54 "name": "callback",
63 "type": "function",
64 "parameters": [ 55 "parameters": [
65 { 56 {
66 "name": "permissions", 57 "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>). The entries may contain either tabs or windows."
67 "$ref": "Permissions",
68 "description": "The extension's active permissions."
69 } 58 }
70 ] 59 ]
71 } 60 }
72 ] 61 ]
73 }, 62 },
74 { 63 {
75 "name": "contains", 64 "name": "getDevices",
76 "type": "function", 65 "type": "function",
77 "description": "Checks if the extension has the specified permissions.", 66 "description": "Retrieves all devices with synced sessions.",
78 "parameters": [ 67 "parameters": [
79 { 68 {
80 "name": "permissions", 69 "$ref": "Filter",
81 "$ref": "Permissions" 70 "name": "filter",
71 "optional": true
82 }, 72 },
83 { 73 {
74 "type": "function",
84 "name": "callback", 75 "name": "callback",
85 "type": "function",
86 "parameters": [ 76 "parameters": [
87 { 77 {
88 "name": "result", 78 "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."
89 "type": "boolean",
90 "description": "True if the extension has the specified permissi ons."
91 } 79 }
92 ] 80 ]
93 } 81 }
94 ] 82 ]
95 }, 83 },
96 { 84 {
97 "name": "request", 85 "name": "restore",
98 "type": "function", 86 "type": "function",
99 "description": "Requests access to the specified permissions. These perm issions must be defined in the optional_permissions field of the manifest. If th ere are any problems requesting the permissions, $ref:runtime.lastError will be set.", 87 "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.",
100 "parameters": [ 88 "parameters": [
101 { 89 {
102 "name": "permissions", 90 "type": "string",
103 "$ref": "Permissions" 91 "name": "sessionId",
92 "optional": true,
93 "description": "The $ref:windows.Window.sessionId, or $ref:tabs.Tab. sessionId to restore."
104 }, 94 },
105 { 95 {
96 "type": "function",
106 "name": "callback", 97 "name": "callback",
107 "type": "function",
108 "optional": true, 98 "optional": true,
109 "parameters": [ 99 "parameters": [
110 { 100 {
111 "name": "granted", 101 "$ref": "Session",
112 "type": "boolean", 102 "name": "restoredSession",
113 "description": "True if the user granted the specified permissio ns." 103 "description": "A $ref:Session containing the restored $ref:wind ows.Window or $ref:tabs.Tab object."
114 }
115 ]
116 }
117 ]
118 },
119 {
120 "name": "remove",
121 "type": "function",
122 "description": "Removes access to the specified permissions. If there ar e any problems removing the permissions, $ref:runtime.lastError will be set.",
123 "parameters": [
124 {
125 "name": "permissions",
126 "$ref": "Permissions"
127 },
128 {
129 "name": "callback",
130 "type": "function",
131 "optional": true,
132 "parameters": [
133 {
134 "name": "removed",
135 "type": "boolean",
136 "description": "True if the permissions were removed."
137 } 104 }
138 ] 105 ]
139 } 106 }
140 ] 107 ]
141 } 108 }
142 ] 109 ],
110 "properties": {
111 "MAX_SESSION_RESULTS": {
112 "value": 25,
113 "description": "The maximum number of $ref:Session that will be included in a requested list."
114 }
115 }
143 } 116 }
144 ] 117 ]
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698