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/browser | |
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/browser')
6 files changed, 12 insertions, 9 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, |