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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/api/sessions.json
diff --git a/chrome/common/extensions/api/permissions.json b/chrome/common/extensions/api/sessions.json
similarity index 27%
copy from chrome/common/extensions/api/permissions.json
copy to chrome/common/extensions/api/sessions.json
index 3ce74b43352e8ae48ef9225c180c021ff9ea842a..a0a4b680bb2119da0f8139c962b073a396189d95 100644
--- a/chrome/common/extensions/api/permissions.json
+++ b/chrome/common/extensions/api/sessions.json
@@ -4,141 +4,114 @@
[
{
- "namespace": "permissions",
- "description": "Use the <code>chrome.permissions</code> API to request <a href=\"#manifest\">declared optional permissions</a> at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary.",
+ "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
+ "description": "Use the <code>chrome.sessions</code> API to query and restore tabs and windows from a browsing session.",
"types": [
{
- "id": "Permissions",
+ "id": "Filter",
"type": "object",
"properties": {
- "permissions": {
- "type": "array",
- "items": {"type": "string"},
+ "maxResults": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 25,
"optional": true,
- "description": "List of named permissions (does not include hosts or origins)."
- },
- "origins": {
- "type": "array",
- "items": {"type": "string"},
- "optional": true,
- "description": "List of origin permissions."
+ "description": "The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries ($ref:MAX_SESSION_RESULTS)."
}
}
- }
- ],
- "events": [
+ },
{
- "name": "onAdded",
- "type": "function",
- "description": "Fired when the extension acquires new permissions.",
- "parameters": [
- {
- "$ref": "Permissions",
- "name": "permissions",
- "description": "The newly acquired permissions."
- }
- ]
+ "id": "Session",
+ "type": "object",
+ "properties": {
+ "lastModified": {"type": "integer", "description": "The time when the window or tab was closed, represented in milliseconds since the epoch"},
+ "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The closed $ref:tabs.Tab, if this entry describes a tab. Either this or $ref:Session.window will be set."},
+ "window": {"$ref": "windows.Window", "optional": true, "description": "The closed $ref:windows.Window, if this entry describes a window. Either this or $ref:Session.tab will be set."}
+ }
},
{
- "name": "onRemoved",
- "type": "function",
- "description": "Fired when access to permissions has been removed from the extension.",
- "parameters": [
- {
- "$ref": "Permissions",
- "name": "permissions",
- "description": "The permissions that have been removed."
- }
- ]
+ "id": "Device",
+ "type": "object",
+ "properties": {
+ "info": {"type": "string", "description": "Represents all information about a foreign device."},
+ "sessions": {"type": "array", "items": {"$ref": "Session"}, "description": "A list of open window sessions for the foreign device, sorted from most recently to least recently modified session."}
+ }
}
- ],
+ ],
"functions": [
{
- "name": "getAll",
+ "name": "getRecentlyClosed",
"type": "function",
- "description": "Gets the extension's current set of permissions.",
+ "description": "Gets the list of recently closed tabs and/or windows.",
"parameters": [
{
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "permissions",
- "$ref": "Permissions",
- "description": "The extension's active permissions."
- }
- ]
- }
- ]
- },
- {
- "name": "contains",
- "type": "function",
- "description": "Checks if the extension has the specified permissions.",
- "parameters": [
- {
- "name": "permissions",
- "$ref": "Permissions"
+ "$ref": "Filter",
+ "name": "filter",
+ "optional": true
},
{
- "name": "callback",
"type": "function",
+ "name": "callback",
"parameters": [
{
- "name": "result",
- "type": "boolean",
- "description": "True if the extension has the specified permissions."
+ "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."
}
]
}
]
},
{
- "name": "request",
+ "name": "getDevices",
"type": "function",
- "description": "Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, $ref:runtime.lastError will be set.",
+ "description": "Retrieves all devices with synced sessions.",
"parameters": [
{
- "name": "permissions",
- "$ref": "Permissions"
+ "$ref": "Filter",
+ "name": "filter",
+ "optional": true
},
{
- "name": "callback",
"type": "function",
- "optional": true,
+ "name": "callback",
"parameters": [
{
- "name": "granted",
- "type": "boolean",
- "description": "True if the user granted the specified permissions."
+ "name": "devices", "type": "array", "items": { "$ref": "Device" }, "description": "The list of $ref:Device objects for each synced session, sorted 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."
}
]
}
]
},
{
- "name": "remove",
+ "name": "restore",
"type": "function",
- "description": "Removes access to the specified permissions. If there are any problems removing the permissions, $ref:runtime.lastError will be set.",
+ "description": "Reopens a $ref:Session, $ref:windows.Window, or $ref:tabs.Tab, with an optional callback to run when the entry has been restored.",
"parameters": [
{
- "name": "permissions",
- "$ref": "Permissions"
+ "type": "string",
+ "name": "sessionId",
+ "optional": true,
+ "description": "The $ref:windows.Window.sessionId, or $ref:tabs.Tab.sessionId to restore."
},
{
- "name": "callback",
"type": "function",
+ "name": "callback",
"optional": true,
"parameters": [
{
- "name": "removed",
- "type": "boolean",
- "description": "True if the permissions were removed."
+ "$ref": "Session",
+ "name": "restoredSession",
+ "description": "A $ref:Session containing the restored $ref:windows.Window or $ref:tabs.Tab object."
}
]
}
]
}
- ]
+ ],
+ "properties": {
+ "MAX_SESSION_RESULTS": {
+ "value": 25,
+ "description": "The maximum number of $ref:Session that will be included in a requested list."
+ }
+ }
}
]

Powered by Google App Engine
This is Rietveld 408576698