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

Unified Diff: trunk/src/chrome/browser/media/media_stream_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/media/media_stream_infobar_delegate.cc
===================================================================
--- trunk/src/chrome/browser/media/media_stream_infobar_delegate.cc (revision 238401)
+++ trunk/src/chrome/browser/media/media_stream_infobar_delegate.cc (working copy)
@@ -8,7 +8,6 @@
#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"
@@ -51,12 +50,12 @@
return false;
}
- scoped_ptr<InfoBar> infobar(ConfirmInfoBarDelegate::CreateInfoBar(
- scoped_ptr<ConfirmInfoBarDelegate>(
- new MediaStreamInfoBarDelegate(controller.Pass()))));
+ scoped_ptr<InfoBarDelegate> infobar(
+ new MediaStreamInfoBarDelegate(infobar_service, controller.Pass()));
for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
- InfoBar* old_infobar = infobar_service->infobar_at(i);
- if (old_infobar->delegate()->AsMediaStreamInfoBarDelegate()) {
+ InfoBarDelegate* old_infobar =
+ infobar_service->infobar_at(i)->AsMediaStreamInfoBarDelegate();
+ if (old_infobar) {
infobar_service->ReplaceInfoBar(old_infobar, infobar.Pass());
return true;
}
@@ -66,8 +65,9 @@
}
MediaStreamInfoBarDelegate::MediaStreamInfoBarDelegate(
+ InfoBarService* infobar_service,
scoped_ptr<MediaStreamDevicesController> controller)
- : ConfirmInfoBarDelegate(),
+ : ConfirmInfoBarDelegate(infobar_service),
controller_(controller.Pass()) {
DCHECK(controller_.get());
DCHECK(controller_->HasAudio() || controller_->HasVideo());

Powered by Google App Engine
This is Rietveld 408576698