| Index: chrome/browser/media/media_stream_infobar_delegate.cc
|
| diff --git a/chrome/browser/media/media_stream_infobar_delegate.cc b/chrome/browser/media/media_stream_infobar_delegate.cc
|
| index f3059d503e965ba2f7f900d9fb1e8ba50106ccfc..8c40ae7669d428c219bf532b6ecde0c59320eda2 100644
|
| --- a/chrome/browser/media/media_stream_infobar_delegate.cc
|
| +++ b/chrome/browser/media/media_stream_infobar_delegate.cc
|
| @@ -9,6 +9,7 @@
|
| #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_manager.h"
|
| #include "chrome/browser/infobars/infobar_service.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "content/public/browser/web_contents.h"
|
| @@ -51,11 +52,12 @@ bool MediaStreamInfoBarDelegate::Create(
|
| return false;
|
| }
|
|
|
| - scoped_ptr<InfoBar> infobar(ConfirmInfoBarDelegate::CreateInfoBar(
|
| - scoped_ptr<ConfirmInfoBarDelegate>(
|
| - new MediaStreamInfoBarDelegate(controller.Pass()))));
|
| - for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
|
| - InfoBar* old_infobar = infobar_service->infobar_at(i);
|
| + scoped_ptr<InfoBar> infobar(
|
| + ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>(
|
| + new MediaStreamInfoBarDelegate(web_contents, controller.Pass()))));
|
| + InfoBarManager& manager = infobar_service->infobar_manager();
|
| + for (size_t i = 0; i < manager.infobar_count(); ++i) {
|
| + InfoBar* old_infobar = manager.infobar_at(i);
|
| if (old_infobar->delegate()->AsMediaStreamInfoBarDelegate()) {
|
| infobar_service->ReplaceInfoBar(old_infobar, infobar.Pass());
|
| return true;
|
| @@ -66,8 +68,9 @@ bool MediaStreamInfoBarDelegate::Create(
|
| }
|
|
|
| MediaStreamInfoBarDelegate::MediaStreamInfoBarDelegate(
|
| + content::WebContents* web_contents,
|
| scoped_ptr<MediaStreamDevicesController> controller)
|
| - : ConfirmInfoBarDelegate(),
|
| + : ContentConfirmInfoBarDelegate(web_contents),
|
| controller_(controller.Pass()) {
|
| DCHECK(controller_.get());
|
| DCHECK(controller_->HasAudio() || controller_->HasVideo());
|
|
|