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

Unified Diff: chrome/browser/infobars/insecure_content_infobar_delegate.cc

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years 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/infobars/insecure_content_infobar_delegate.cc
===================================================================
--- chrome/browser/infobars/insecure_content_infobar_delegate.cc (revision 238220)
+++ chrome/browser/infobars/insecure_content_infobar_delegate.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/metrics/histogram.h"
#include "chrome/browser/google/google_util.h"
+#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/common/render_messages.h"
#include "content/public/browser/render_view_host.h"
@@ -18,18 +19,20 @@
// static
void InsecureContentInfoBarDelegate::Create(InfoBarService* infobar_service,
InfoBarType type) {
- scoped_ptr<InfoBarDelegate> new_infobar(
- new InsecureContentInfoBarDelegate(infobar_service, type));
+ scoped_ptr<InfoBar> new_infobar(ConfirmInfoBarDelegate::CreateInfoBar(
+ scoped_ptr<ConfirmInfoBarDelegate>(
+ new InsecureContentInfoBarDelegate(type))));
// Only supsersede an existing insecure content infobar if we are upgrading
// from DISPLAY to RUN.
for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
+ InfoBar* old_infobar = infobar_service->infobar_at(i);
InsecureContentInfoBarDelegate* delegate =
- infobar_service->infobar_at(i)->AsInsecureContentInfoBarDelegate();
+ old_infobar->delegate()->AsInsecureContentInfoBarDelegate();
if (delegate != NULL) {
if ((type == RUN) && (delegate->type_ == DISPLAY))
return;
- infobar_service->ReplaceInfoBar(delegate, new_infobar.Pass());
+ infobar_service->ReplaceInfoBar(old_infobar, new_infobar.Pass());
break;
}
}
@@ -41,10 +44,8 @@
NUM_EVENTS);
}
-InsecureContentInfoBarDelegate::InsecureContentInfoBarDelegate(
- InfoBarService* infobar_service,
- InfoBarType type)
- : ConfirmInfoBarDelegate(infobar_service),
+InsecureContentInfoBarDelegate::InsecureContentInfoBarDelegate(InfoBarType type)
+ : ConfirmInfoBarDelegate(),
type_(type) {
}
« no previous file with comments | « chrome/browser/infobars/insecure_content_infobar_delegate.h ('k') | chrome/browser/infobars/simple_alert_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698