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

Unified Diff: chrome/browser/custom_handlers/register_protocol_handler_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/custom_handlers/register_protocol_handler_infobar_delegate.cc
===================================================================
--- chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc (revision 238220)
+++ chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
+#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/user_metrics.h"
@@ -21,17 +22,18 @@
content::RecordAction(
content::UserMetricsAction("RegisterProtocolHandler.InfoBar_Shown"));
- scoped_ptr<InfoBarDelegate> infobar(
- new RegisterProtocolHandlerInfoBarDelegate(infobar_service, registry,
- handler));
+ scoped_ptr<InfoBar> infobar(ConfirmInfoBarDelegate::CreateInfoBar(
+ scoped_ptr<ConfirmInfoBarDelegate>(
+ new RegisterProtocolHandlerInfoBarDelegate(registry, handler))));
for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
+ InfoBar* existing_infobar = infobar_service->infobar_at(i);
RegisterProtocolHandlerInfoBarDelegate* existing_delegate =
- infobar_service->infobar_at(i)->
+ existing_infobar->delegate()->
AsRegisterProtocolHandlerInfoBarDelegate();
if ((existing_delegate != NULL) &&
existing_delegate->handler_.IsEquivalent(handler)) {
- infobar_service->ReplaceInfoBar(existing_delegate, infobar.Pass());
+ infobar_service->ReplaceInfoBar(existing_infobar, infobar.Pass());
return;
}
}
@@ -40,10 +42,9 @@
}
RegisterProtocolHandlerInfoBarDelegate::RegisterProtocolHandlerInfoBarDelegate(
- InfoBarService* infobar_service,
ProtocolHandlerRegistry* registry,
const ProtocolHandler& handler)
- : ConfirmInfoBarDelegate(infobar_service),
+ : ConfirmInfoBarDelegate(),
registry_(registry),
handler_(handler) {
}

Powered by Google App Engine
This is Rietveld 408576698