From f34e7963c796bda1eb7fd35f5eda0d878c2df4e6 Mon Sep 17 00:00:00 2001 From: "finnur@chromium.org" Date: Wed, 17 Mar 2010 02:34:08 +0000 Subject: First cut at adding Extension Infobars to the experimental API. Originally described here: http://code.google.com/p/chromium/wiki/InfoBarExtensionAPI The API is simple: chrome.experimental.infoBar.show( {"htmlPath": "infobar.html"}, function(window) { // |window| is where the infobar was shown. }); To close it, you can simply call window.close() from within the InfoBar (infoBar.hide is not provided). The api is privileged (not available to content scripts directly). The minimum height for the infobar is regular height for our infobars (32 pixels), maximum is twice that and the actual size is determined by the content (within these constraints mentioned). See screenshot in bug. The icon on the far left is an extension icon with a dropdown menu showing the menu that shows when you right-click on the extension icon in the Omnibox/browser action container. BUG=26463 TEST=None (for now). Review URL: http://codereview.chromium.org/1049001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41806 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/extensions/api/extension_api.json | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'chrome/common/extensions/api') diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json index c53700d..afdfc24 100755 --- a/chrome/common/extensions/api/extension_api.json +++ b/chrome/common/extensions/api/extension_api.json @@ -1392,6 +1392,44 @@ ] }, { + "namespace": "experimental.infoBar", + "types": [], + "functions": [ + { + "name": "show", + "type": "function", + "description": "Shows an infobar in the specified tab.", + "parameters": [ + { + "name": "details", + "type": "object", + "properties": { + "tabId": { + "type": "integer", + "description": "The tab id for the tab to display the infobar in. If not specified the current tab will be used.", + "optional": true + }, + "htmlPath": { + "type": "string", + "description": "The html file that contains the infobar." + } + } + }, + { + "type": "function", + "name": "callback", + "parameters": [ + { + "name": "window", "$ref": "Window", "description": "Contains details about the window in which the infobar was created.", + "optional": true + } + ] + } + ] + } + ] + }, + { "namespace": "bookmarks", "types": [ { -- cgit v1.1