diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-18 21:30:32 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-18 21:30:32 +0000 |
commit | df3bdcf1d352aeaf38218da358d3dbf387c92cde (patch) | |
tree | be6580763293feca29d7ac0ab524cfef86034190 /chrome | |
parent | 96e284571293e7706dc95acf919f2be8ac621127 (diff) | |
download | chromium_src-df3bdcf1d352aeaf38218da358d3dbf387c92cde.zip chromium_src-df3bdcf1d352aeaf38218da358d3dbf387c92cde.tar.gz chromium_src-df3bdcf1d352aeaf38218da358d3dbf387c92cde.tar.bz2 |
Minor extension infobar changes.
Addressing review comments that were submitted after I checked in.
BUG=26463
TEST=None
Review URL: http://codereview.chromium.org/1097002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/extensions/extension_host.h | 2 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_infobar_delegate.h | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_infobar_module.cc | 9 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_infobar_module.h | 2 | ||||
-rw-r--r-- | chrome/browser/views/extensions/extension_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/infobars/extension_infobar.cc | 2 | ||||
-rwxr-xr-x | chrome/common/extensions/api/extension_api.json | 4 | ||||
-rw-r--r-- | chrome/common/extensions/docs/experimental.html | 2 | ||||
-rw-r--r-- | chrome/common/extensions/docs/experimental.infobars.html (renamed from chrome/common/extensions/docs/experimental.infoBar.html) | 12 | ||||
-rw-r--r-- | chrome/common/extensions/docs/manifest.html | 6 | ||||
-rw-r--r-- | chrome/common/extensions/docs/static/manifest.html | 6 | ||||
-rw-r--r-- | chrome/renderer/resources/renderer_extension_bindings.js | 2 |
12 files changed, 32 insertions, 21 deletions
diff --git a/chrome/browser/extensions/extension_host.h b/chrome/browser/extensions/extension_host.h index ad26e9f..509bc1f 100644 --- a/chrome/browser/extensions/extension_host.h +++ b/chrome/browser/extensions/extension_host.h @@ -99,7 +99,7 @@ class ExtensionHost : public RenderViewHostDelegate, // Sets |url_| and navigates |render_view_host_|. void NavigateToURL(const GURL& url); - // Insert a default style sheet for Extension InfoBars. + // Insert a default style sheet for Extension Infobars. void InsertInfobarCSS(); // Insert the theme CSS for a toolstrip/mole. diff --git a/chrome/browser/extensions/extension_infobar_delegate.h b/chrome/browser/extensions/extension_infobar_delegate.h index 485b288..483155e 100644 --- a/chrome/browser/extensions/extension_infobar_delegate.h +++ b/chrome/browser/extensions/extension_infobar_delegate.h @@ -12,8 +12,8 @@ class Extension; class ExtensionHost; class TabContents; -// An interface derived from InfoBarDelegate to form the base interface for -// extension InfoBars. +// The InfobarDelegate for creating and managing state for the ExtensionInfobar +// plus monitor when the extension goes away. class ExtensionInfoBarDelegate : public InfoBarDelegate, public NotificationObserver { public: diff --git a/chrome/browser/extensions/extension_infobar_module.cc b/chrome/browser/extensions/extension_infobar_module.cc index 491b278..fb5b2ed 100644 --- a/chrome/browser/extensions/extension_infobar_module.cc +++ b/chrome/browser/extensions/extension_infobar_module.cc @@ -6,12 +6,14 @@ #include "app/l10n_util.h" #include "chrome/browser/browser.h" +#include "chrome/browser/extensions/extension_host.h" #include "chrome/browser/extensions/extension_infobar_module_constants.h" #include "chrome/browser/extensions/extension_infobar_delegate.h" #include "chrome/browser/extensions/extension_tabs_module.h" #include "chrome/browser/extensions/extension_tabs_module_constants.h" #include "chrome/browser/tab_contents/infobar_delegate.h" #include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/common/extensions/extension.h" #include "chrome/common/url_constants.h" #include "grit/generated_resources.h" @@ -24,9 +26,8 @@ bool ShowInfoBarFunction::RunImpl() { std::string html_path; EXTENSION_FUNCTION_VALIDATE(args->GetString(keys::kHtmlPath, &html_path)); - GURL url = GURL(std::string(chrome::kExtensionScheme) + - chrome::kStandardSchemeSeparator + - extension_id() + "/" + html_path); + Extension* extension = dispatcher()->GetExtension(); + GURL url = extension->GetResourceURL(extension->url(), html_path); Browser* browser = dispatcher()->GetBrowser(true); if (!browser) { @@ -40,7 +41,7 @@ bool ShowInfoBarFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(args->GetInteger(keys::kTabId, &tab_id)); EXTENSION_FUNCTION_VALIDATE(ExtensionTabUtil::GetTabById( - tab_id, browser->profile(), false, // No incognito. + tab_id, browser->profile(), true, // Allow infobar in incognito. NULL, NULL, &tab_contents, NULL)); } else { tab_contents = browser->GetSelectedTabContents(); diff --git a/chrome/browser/extensions/extension_infobar_module.h b/chrome/browser/extensions/extension_infobar_module.h index 3414b19..e05dbf1 100644 --- a/chrome/browser/extensions/extension_infobar_module.h +++ b/chrome/browser/extensions/extension_infobar_module.h @@ -10,7 +10,7 @@ class ShowInfoBarFunction : public SyncExtensionFunction { ~ShowInfoBarFunction() {} virtual bool RunImpl(); - DECLARE_EXTENSION_FUNCTION_NAME("experimental.infoBar.show") + DECLARE_EXTENSION_FUNCTION_NAME("experimental.infobars.show") }; #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFOBAR_MODULE_H_ diff --git a/chrome/browser/views/extensions/extension_view.cc b/chrome/browser/views/extensions/extension_view.cc index 23d25f3..0090bda 100644 --- a/chrome/browser/views/extensions/extension_view.cc +++ b/chrome/browser/views/extensions/extension_view.cc @@ -62,7 +62,7 @@ void ExtensionView::SetVisible(bool is_visible) { NativeViewHost::SetVisible(is_visible); // Also tell RenderWidgetHostView the new visibility. Despite its name, it - // is not part of the View heirarchy and does not know about the change + // is not part of the View hierarchy and does not know about the change // unless we tell it. if (render_view_host()->view()) { if (is_visible) diff --git a/chrome/browser/views/infobars/extension_infobar.cc b/chrome/browser/views/infobars/extension_infobar.cc index 9303aff..4fcaa87 100644 --- a/chrome/browser/views/infobars/extension_infobar.cc +++ b/chrome/browser/views/infobars/extension_infobar.cc @@ -104,6 +104,8 @@ void ExtensionInfoBar::RunMenu(View* source, const gfx::Point& pt) { void ExtensionInfoBar::SetupIconAndMenu() { SkBitmap icon; + // TODO(finnur): http://crbug.com/38521. Use cached version of the Extension + // icon instead of loading it here. ExtensionResource icon_resource; Extension::Icons size = delegate_->extension_host()->extension()-> GetIconPathAllowLargerSize(&icon_resource, diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json index 2175e96..8925e81 100755 --- a/chrome/common/extensions/api/extension_api.json +++ b/chrome/common/extensions/api/extension_api.json @@ -1392,13 +1392,13 @@ ] }, { - "namespace": "experimental.infoBar", + "namespace": "experimental.infobars", "types": [], "functions": [ { "name": "show", "type": "function", - "description": "Shows an infobar in the specified tab.", + "description": "Shows an infobar in the specified tab. The infobar will be closed automatically when the tab navigates. Use window.close() to close the infobar before then.", "parameters": [ { "name": "details", diff --git a/chrome/common/extensions/docs/experimental.html b/chrome/common/extensions/docs/experimental.html index 1b03ac4..566bfe9 100644 --- a/chrome/common/extensions/docs/experimental.html +++ b/chrome/common/extensions/docs/experimental.html @@ -256,7 +256,7 @@ on the following experimental APIs: </p> <ul> - <li><a href="experimental.clipboard.html" js="">experimental.clipboard</a></li><li><a href="experimental.history.html" js="">experimental.history</a></li><li><a href="experimental.infoBar.html" js="">experimental.infoBar</a></li><li><a href="experimental.processes.html" js="">experimental.processes</a></li> + <li><a href="experimental.clipboard.html" js="">experimental.clipboard</a></li><li><a href="experimental.history.html" js="">experimental.history</a></li><li><a href="experimental.infobars.html" js="">experimental.infobars</a></li><li><a href="experimental.processes.html" js="">experimental.processes</a></li> </ul> <p class="caution"> diff --git a/chrome/common/extensions/docs/experimental.infoBar.html b/chrome/common/extensions/docs/experimental.infobars.html index 87c1861..1b414db 100644 --- a/chrome/common/extensions/docs/experimental.infoBar.html +++ b/chrome/common/extensions/docs/experimental.infobars.html @@ -15,7 +15,7 @@ </script> <script type="text/javascript" src="js/api_page_generator.js"></script> <script type="text/javascript" src="js/bootstrap.js"></script> - <title>chrome.experimental.infoBar - Google Chrome Extensions - Google Code</title></head><body> <div id="gc-container" class="labs"> + <title>chrome.experimental.infobars - Google Chrome Extensions - Google Code</title></head><body> <div id="gc-container" class="labs"> <div id="devModeWarning"> You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files. </div> @@ -192,7 +192,7 @@ <div class="g-unit" id="gc-pagecontent"> <div id="pageTitle"> - <h1 class="page_title">chrome.experimental.infoBar</h1> + <h1 class="page_title">chrome.experimental.infobars</h1> </div> <!-- TABLE OF CONTENTS --> <div id="toc"> @@ -207,7 +207,7 @@ </ol> </li> <li> - <a href="#apiReference">API reference: chrome.experimental.infoBar</a> + <a href="#apiReference">API reference: chrome.experimental.infobars</a> <ol> <li style="display: none; "> <a href="#properties">Properties</a> @@ -253,7 +253,7 @@ <!-- API PAGE --> <div class="apiPage"> <a name="apiReference"></a> - <h2>API reference: chrome.experimental.infoBar</h2> + <h2>API reference: chrome.experimental.infobars</h2> <!-- PROPERTIES --> <div class="apiGroup" style="display: none; "> @@ -285,13 +285,13 @@ <div class="summary"><span style="display: none; ">void</span> <!-- Note: intentionally longer 80 columns --> - <span>chrome.experimental.infoBar.show</span>(<span class="null"><span style="display: none; ">, </span><span>object</span> + <span>chrome.experimental.infobars.show</span>(<span class="null"><span style="display: none; ">, </span><span>object</span> <var><span>details</span></var></span><span class="null"><span>, </span><span>function</span> <var><span>callback</span></var></span>)</div> <div class="description"> <p class="todo" style="display: none; ">Undocumented.</p> - <p>Shows an infobar in the specified tab.</p> + <p>Shows an infobar in the specified tab. The infobar will be closed automatically when the tab navigates. Use window.close() to close the infobar before then.</p> <!-- PARAMETERS --> <h4>Parameters</h4> diff --git a/chrome/common/extensions/docs/manifest.html b/chrome/common/extensions/docs/manifest.html index e99a05f..f30fea7 100644 --- a/chrome/common/extensions/docs/manifest.html +++ b/chrome/common/extensions/docs/manifest.html @@ -357,11 +357,15 @@ including BMP, GIF, ICO, and JPEG. Here's an example of specifying the icons: </p> -<pre>"icons": { "48": "icon48.png", +<pre>"icons": { "16": "icon16.png", + "48": "icon48.png", "128": "icon128.png" }, </pre> <p> +If you use infobars, you should also specify +a 16x16-pixel logo, for displaying within the +infobar. If you submit your extension to the <a href="https://chrome.google.com/extensions">gallery</a>, you'll need to upload additional images, diff --git a/chrome/common/extensions/docs/static/manifest.html b/chrome/common/extensions/docs/static/manifest.html index ff789cd..2b6dc86 100644 --- a/chrome/common/extensions/docs/static/manifest.html +++ b/chrome/common/extensions/docs/static/manifest.html @@ -90,11 +90,15 @@ Here's an example of specifying the icons: </p> <pre> -"icons": { "48": "icon48.png", +"icons": { "16": "icon16.png", + "48": "icon48.png", "128": "icon128.png" }, </pre> <p> +If you use infobars, you should also specify +a 16x16-pixel logo, for displaying within the +infobar. If you submit your extension to the <a href="https://chrome.google.com/extensions">gallery</a>, you'll need to upload additional images, diff --git a/chrome/renderer/resources/renderer_extension_bindings.js b/chrome/renderer/resources/renderer_extension_bindings.js index d207267..17c09f1 100644 --- a/chrome/renderer/resources/renderer_extension_bindings.js +++ b/chrome/renderer/resources/renderer_extension_bindings.js @@ -250,7 +250,7 @@ var chrome = chrome || {}; "experimental.extension", "experimental.idle", "experimental.history", - "experimental.infoBar", + "experimental.infobars", "experimental.metrics", "experimental.popup", "experimental.processes", |