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

Unified Diff: trunk/src/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc

Issue 102163002: Revert 238283 "Infobar system refactor." (Closed) Base URL: svn://svn.chromium.org/chrome/
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: trunk/src/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc
===================================================================
--- trunk/src/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc (revision 238401)
+++ trunk/src/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc (working copy)
@@ -6,7 +6,6 @@
#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"
@@ -22,18 +21,17 @@
content::RecordAction(
content::UserMetricsAction("RegisterProtocolHandler.InfoBar_Shown"));
- scoped_ptr<InfoBar> infobar(ConfirmInfoBarDelegate::CreateInfoBar(
- scoped_ptr<ConfirmInfoBarDelegate>(
- new RegisterProtocolHandlerInfoBarDelegate(registry, handler))));
+ scoped_ptr<InfoBarDelegate> infobar(
+ new RegisterProtocolHandlerInfoBarDelegate(infobar_service, registry,
+ handler));
for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
- InfoBar* existing_infobar = infobar_service->infobar_at(i);
RegisterProtocolHandlerInfoBarDelegate* existing_delegate =
- existing_infobar->delegate()->
+ infobar_service->infobar_at(i)->
AsRegisterProtocolHandlerInfoBarDelegate();
if ((existing_delegate != NULL) &&
existing_delegate->handler_.IsEquivalent(handler)) {
- infobar_service->ReplaceInfoBar(existing_infobar, infobar.Pass());
+ infobar_service->ReplaceInfoBar(existing_delegate, infobar.Pass());
return;
}
}
@@ -42,9 +40,10 @@
}
RegisterProtocolHandlerInfoBarDelegate::RegisterProtocolHandlerInfoBarDelegate(
+ InfoBarService* infobar_service,
ProtocolHandlerRegistry* registry,
const ProtocolHandler& handler)
- : ConfirmInfoBarDelegate(),
+ : ConfirmInfoBarDelegate(infobar_service),
registry_(registry),
handler_(handler) {
}

Powered by Google App Engine
This is Rietveld 408576698