Index: chrome/browser/media/media_stream_infobar_delegate.cc |
=================================================================== |
--- chrome/browser/media/media_stream_infobar_delegate.cc (revision 238220) |
+++ chrome/browser/media/media_stream_infobar_delegate.cc (working copy) |
@@ -8,6 +8,7 @@ |
#include "base/metrics/histogram.h" |
#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/google/google_util.h" |
+#include "chrome/browser/infobars/infobar.h" |
#include "chrome/browser/infobars/infobar_service.h" |
#include "chrome/common/url_constants.h" |
#include "content/public/browser/web_contents.h" |
@@ -50,12 +51,12 @@ |
return false; |
} |
- scoped_ptr<InfoBarDelegate> infobar( |
- new MediaStreamInfoBarDelegate(infobar_service, controller.Pass())); |
+ scoped_ptr<InfoBar> infobar(ConfirmInfoBarDelegate::CreateInfoBar( |
+ scoped_ptr<ConfirmInfoBarDelegate>( |
+ new MediaStreamInfoBarDelegate(controller.Pass())))); |
for (size_t i = 0; i < infobar_service->infobar_count(); ++i) { |
- InfoBarDelegate* old_infobar = |
- infobar_service->infobar_at(i)->AsMediaStreamInfoBarDelegate(); |
- if (old_infobar) { |
+ InfoBar* old_infobar = infobar_service->infobar_at(i); |
+ if (old_infobar->delegate()->AsMediaStreamInfoBarDelegate()) { |
infobar_service->ReplaceInfoBar(old_infobar, infobar.Pass()); |
return true; |
} |
@@ -65,9 +66,8 @@ |
} |
MediaStreamInfoBarDelegate::MediaStreamInfoBarDelegate( |
- InfoBarService* infobar_service, |
scoped_ptr<MediaStreamDevicesController> controller) |
- : ConfirmInfoBarDelegate(infobar_service), |
+ : ConfirmInfoBarDelegate(), |
controller_(controller.Pass()) { |
DCHECK(controller_.get()); |
DCHECK(controller_->HasAudio() || controller_->HasVideo()); |