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

Unified Diff: chrome/browser/media/webrtc_browsertest_base.cc

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 2 months 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/webrtc_browsertest_base.cc
===================================================================
--- chrome/browser/media/webrtc_browsertest_base.cc (revision 226624)
+++ chrome/browser/media/webrtc_browsertest_base.cc (working copy)
@@ -35,9 +35,8 @@
void WebRtcTestBase::GetUserMediaWithSpecificConstraintsAndAccept(
content::WebContents* tab_contents,
const std::string& constraints) {
- MediaStreamInfoBarDelegate* infobar =
- GetUserMediaAndWaitForInfoBar(tab_contents, constraints);
- infobar->Accept();
+ InfoBar* infobar = GetUserMediaAndWaitForInfoBar(tab_contents, constraints);
+ infobar->delegate()->AsConfirmInfoBarDelegate()->Accept();
CloseInfoBarInTab(tab_contents, infobar);
// Wait for WebRTC to call the success callback.
@@ -54,9 +53,8 @@
void WebRtcTestBase::GetUserMediaWithSpecificConstraintsAndDeny(
content::WebContents* tab_contents,
const std::string& constraints) {
- MediaStreamInfoBarDelegate* infobar =
- GetUserMediaAndWaitForInfoBar(tab_contents, constraints);
- infobar->Cancel();
+ InfoBar* infobar = GetUserMediaAndWaitForInfoBar(tab_contents, constraints);
+ infobar->delegate()->AsConfirmInfoBarDelegate()->Cancel();
CloseInfoBarInTab(tab_contents, infobar);
// Wait for WebRTC to call the fail callback.
@@ -66,9 +64,9 @@
void WebRtcTestBase::GetUserMediaAndDismiss(
content::WebContents* tab_contents) {
- MediaStreamInfoBarDelegate* infobar =
+ InfoBar* infobar =
GetUserMediaAndWaitForInfoBar(tab_contents, kAudioVideoCallConstraints);
- infobar->InfoBarDismissed();
+ infobar->delegate()->InfoBarDismissed();
CloseInfoBarInTab(tab_contents, infobar);
// A dismiss should be treated like a deny.
@@ -85,7 +83,7 @@
EXPECT_EQ("ok-requested", result);
}
-MediaStreamInfoBarDelegate* WebRtcTestBase::GetUserMediaAndWaitForInfoBar(
+InfoBar* WebRtcTestBase::GetUserMediaAndWaitForInfoBar(
content::WebContents* tab_contents,
const std::string& constraints) {
content::WindowedNotificationObserver infobar_added(
@@ -97,14 +95,13 @@
// Wait for the bar to pop up, then return it.
infobar_added.Wait();
- content::Details<InfoBarAddedDetails> details(infobar_added.details());
- MediaStreamInfoBarDelegate* infobar = details->AsMediaStreamInfoBarDelegate();
- EXPECT_TRUE(infobar);
- return infobar;
+ content::Details<InfoBar::AddedDetails> details(infobar_added.details());
+ EXPECT_TRUE(details->delegate()->AsMediaStreamInfoBarDelegate());
+ return details.ptr();
}
void WebRtcTestBase::CloseInfoBarInTab(content::WebContents* tab_contents,
- MediaStreamInfoBarDelegate* infobar) {
+ InfoBar* infobar) {
content::WindowedNotificationObserver infobar_removed(
chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
content::NotificationService::AllSources());

Powered by Google App Engine
This is Rietveld 408576698