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

Unified Diff: chrome/browser/extensions/extension_infobar_delegate.cc

Issue 11644059: Change infobar creation to use a public static Create() method on the infobar delegate classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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
Index: chrome/browser/extensions/extension_infobar_delegate.cc
===================================================================
--- chrome/browser/extensions/extension_infobar_delegate.cc (revision 175396)
+++ chrome/browser/extensions/extension_infobar_delegate.cc (working copy)
@@ -16,6 +16,23 @@
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
+
+ExtensionInfoBarDelegate::~ExtensionInfoBarDelegate() {
+ if (observer_)
+ observer_->OnDelegateDeleted();
+}
+
+// static
+void ExtensionInfoBarDelegate::Create(InfoBarService* infobar_service,
+ Browser* browser,
+ const extensions::Extension* extension,
+ const GURL& url,
+ int height) {
+ infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
+ new ExtensionInfoBarDelegate(browser, infobar_service, extension, url,
+ height)));
+}
+
ExtensionInfoBarDelegate::ExtensionInfoBarDelegate(
Browser* browser,
InfoBarService* infobar_service,
@@ -54,11 +71,6 @@
height_ = default_height;
}
-ExtensionInfoBarDelegate::~ExtensionInfoBarDelegate() {
- if (observer_)
- observer_->OnDelegateDeleted();
-}
-
bool ExtensionInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
ExtensionInfoBarDelegate* extension_delegate =
delegate->AsExtensionInfoBarDelegate();
« no previous file with comments | « chrome/browser/extensions/extension_infobar_delegate.h ('k') | chrome/browser/extensions/extension_install_ui_default.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698