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) { |
} |