From 37ad8892fe9576eef898295e50e7d42b5d7a3e27 Mon Sep 17 00:00:00 2001 From: "finnur@chromium.org" Date: Fri, 26 Mar 2010 21:44:32 +0000 Subject: Add two Extension view types: Notification and Infobars. Also hooked them up to GetExtensionViews and consolidated various methods of getting views into one (getViews, which now takes an optional param type). BUG=26463 TEST=None Review URL: http://codereview.chromium.org/1397002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42828 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/extensions/api/extension_api.json | 28 ++- chrome/common/extensions/docs/extension.html | 245 ++++++++++++++---------- 2 files changed, 163 insertions(+), 110 deletions(-) (limited to 'chrome/common/extensions') diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json index 1adf289..5ab7351 100755 --- a/chrome/common/extensions/api/extension_api.json +++ b/chrome/common/extensions/api/extension_api.json @@ -125,8 +125,27 @@ { "name": "getViews", "type": "function", - "description": "Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension. This includes background pages and tabs.", - "parameters": [], + "description": "Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension.", + "parameters": [ + { + "type": "object", + "name": "fetchProperties", + "optional": true, + "properties": { + "type": { + "type": "string", + "enum": ["tab", "infobar", "notification"], + "optional": true, + "description": "The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'infobar', 'notification'." + }, + "windowId": { + "type": "integer", + "optional": true, + "description": "The window to restrict the search to. If omitted, returns all views." + } + } + } + ], "returns": { "type": "array", "description": "Array of global objects", @@ -146,7 +165,7 @@ "name": "getToolstrips", "nodoc": true, "type": "function", - "description": "Returns an array of the JavaScript 'window' objects for each of the toolstrip views running inside the current extension. If windowId is specified, returns only the 'window' objects of toolstrips attached to the specified window.", + "description": "Deprecated. Please use getViews({type: 'TOOLSTRIP'}). Returns an array of the JavaScript 'window' objects for each of the toolstrip views running inside the current extension. If windowId is specified, returns only the 'window' objects of toolstrips attached to the specified window.", "parameters": [ {"type": "integer", "name": "windowId", "optional": true} ], @@ -158,8 +177,9 @@ }, { "name": "getExtensionTabs", + "nodoc": true, "type": "function", - "description": "Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window.", + "description": "Deprecated. Please use getViews({type: 'TAB'}). Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window.", "parameters": [ {"type": "integer", "name": "windowId", "optional": true} ], diff --git a/chrome/common/extensions/docs/extension.html b/chrome/common/extensions/docs/extension.html index 8285e27..f4ba4dd 100644 --- a/chrome/common/extensions/docs/extension.html +++ b/chrome/common/extensions/docs/extension.html @@ -228,8 +228,8 @@ connect
  • getBackgroundPage -
  • - getExtensionTabs +
  • + methodName
  • methodName
  • @@ -825,65 +825,27 @@ For details, see -
    - -

    getExtensionTabs

    +
    -
    +

    Callback function

    @@ -1168,19 +1082,138 @@ For details, see

    array of DOMWindow - chrome.extension.getViews(, - )
    + chrome.extension.getViews(, object + fetchProperties)
    -

    Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension. This includes background pages and tabs.

    +

    Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension.

    Parameters

    -
    +
    -
    +
    + fetchProperties + + + +
    + ( + optional + + + Type + + + + array of + + object + + + ) +
    + +
    +
    +
    + Undocumented. +
    +
    + Description of this parameter from the json schema. +
    + + +
    +
    +
    +
    +
    + type + + + +
    + ( + optional + + + Type + + + + array of + + string + + + ) +
    + +
    +
    + +
    The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'infobar', 'notification'.
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + windowId + + + +
    + ( + optional + + + Type + + + + array of + + integer + + + ) +
    + +
    +
    + +
    The window to restrict the search to. If omitted, returns all views.
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    -- cgit v1.1