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

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: delete test. 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
« no previous file with comments | « chrome/common/extensions/api/session_restore.json ('k') | chrome/common/extensions/api/tabs.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/sessions.json
diff --git a/chrome/common/extensions/api/sessions.json b/chrome/common/extensions/api/sessions.json
new file mode 100644
index 0000000000000000000000000000000000000000..2f5c85dfb2531605e3c6f55a207c5ae78dd42fcd
--- /dev/null
+++ b/chrome/common/extensions/api/sessions.json
@@ -0,0 +1,117 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ {
+ "namespace": "sessions",
+ "description": "Use the <code>chrome.sessions</code> API to query and restore tabs and windows from a browsing session.",
+ "types": [
+ {
+ "id": "Filter",
+ "type": "object",
+ "properties": {
+ "maxResults": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 25,
+ "optional": true,
+ "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)."
+ }
+ }
+ },
+ {
+ "id": "Session",
+ "type": "object",
+ "properties": {
+ "lastModified": {"type": "integer", "description": "The time when the window or tab was closed or modified, represented in milliseconds since the epoch."},
+ "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The $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 $ref:windows.Window, if this entry describes a window. Either this or $ref:Session.tab will be set."}
+ }
+ },
+ {
+ "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": "getRecentlyClosed",
+ "type": "function",
+ "description": "Gets the list of recently closed tabs and/or windows.",
+ "parameters": [
+ {
+ "$ref": "Filter",
+ "name": "filter",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "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": "getDevices",
+ "type": "function",
+ "description": "Retrieves all devices with synced sessions.",
+ "parameters": [
+ {
+ "$ref": "Filter",
+ "name": "filter",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "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": "restore",
+ "type": "function",
+ "description": "Reopens a $ref:windows.Window or $ref:tabs.Tab, with an optional callback to run when the entry has been restored.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "sessionId",
+ "optional": true,
+ "description": "The $ref:windows.Window.sessionId, or $ref:tabs.Tab.sessionId to restore."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$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."
+ }
+ }
+ }
+]
« no previous file with comments | « chrome/common/extensions/api/session_restore.json ('k') | chrome/common/extensions/api/tabs.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698