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

Unified Diff: chrome/browser/ssl/ssl_tab_helper.cc

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 2 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/ssl/ssl_tab_helper.cc
===================================================================
--- chrome/browser/ssl/ssl_tab_helper.cc (revision 226624)
+++ chrome/browser/ssl/ssl_tab_helper.cc (working copy)
@@ -42,18 +42,17 @@
class SSLCertResultInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
- // Creates an SSL cert result infobar delegate. If |previous_infobar| is
+ // Creates an SSL cert result infobar and delegate. If |previous_infobar| is
// NULL, adds the infobar to |infobar_service|; otherwise, replaces
// |previous_infobar|. Returns the new infobar if it was successfully added.
// |cert| is valid iff cert addition was successful.
- static InfoBarDelegate* Create(InfoBarService* infobar_service,
- InfoBarDelegate* previous_infobar,
- const string16& message,
- net::X509Certificate* cert);
+ static InfoBar* Create(InfoBarService* infobar_service,
+ InfoBar* previous_infobar,
+ const string16& message,
+ net::X509Certificate* cert);
private:
- SSLCertResultInfoBarDelegate(InfoBarService* infobar_service,
- const string16& message,
+ SSLCertResultInfoBarDelegate(const string16& message,
net::X509Certificate* cert);
virtual ~SSLCertResultInfoBarDelegate();
@@ -72,13 +71,13 @@
};
// static
-InfoBarDelegate* SSLCertResultInfoBarDelegate::Create(
- InfoBarService* infobar_service,
- InfoBarDelegate* previous_infobar,
- const string16& message,
- net::X509Certificate* cert) {
- scoped_ptr<InfoBarDelegate> infobar(
- new SSLCertResultInfoBarDelegate(infobar_service, message, cert));
+InfoBar* SSLCertResultInfoBarDelegate::Create(InfoBarService* infobar_service,
+ InfoBar* previous_infobar,
+ const string16& message,
+ net::X509Certificate* cert) {
+ scoped_ptr<InfoBar> infobar(ConfirmInfoBarDelegate::CreateInfoBar(
+ scoped_ptr<ConfirmInfoBarDelegate>(
+ new SSLCertResultInfoBarDelegate(message, cert))));
return previous_infobar ?
infobar_service->ReplaceInfoBar(previous_infobar, infobar.Pass()) :
infobar_service->AddInfoBar(infobar.Pass());
@@ -85,10 +84,9 @@
}
SSLCertResultInfoBarDelegate::SSLCertResultInfoBarDelegate(
- InfoBarService* infobar_service,
const string16& message,
net::X509Certificate* cert)
- : ConfirmInfoBarDelegate(infobar_service),
+ : ConfirmInfoBarDelegate(),
message_(message),
cert_(cert) {
}
@@ -147,7 +145,7 @@
const content::NotificationDetails& details) OVERRIDE;
InfoBarService* infobar_service_;
- InfoBarDelegate* infobar_;
+ InfoBar* infobar_;
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(SSLAddCertData);
@@ -180,8 +178,8 @@
type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REPLACED);
if (infobar_ ==
((type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED) ?
- content::Details<InfoBarRemovedDetails>(details)->first :
- content::Details<InfoBarReplacedDetails>(details)->first))
+ content::Details<InfoBar::RemovedDetails>(details)->first :
+ content::Details<InfoBar::ReplacedDetails>(details)->first))
infobar_ = NULL;
}

Powered by Google App Engine
This is Rietveld 408576698