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

Unified Diff: chrome/browser/media/media_stream_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/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());
« no previous file with comments | « chrome/browser/media/media_stream_infobar_delegate.h ('k') | chrome/browser/media/midi_permission_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698