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

Unified Diff: trunk/src/chrome/browser/media/webrtc_browsertest_base.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/webrtc_browsertest_base.cc
===================================================================
--- trunk/src/chrome/browser/media/webrtc_browsertest_base.cc (revision 238401)
+++ trunk/src/chrome/browser/media/webrtc_browsertest_base.cc (working copy)
@@ -38,8 +38,9 @@
void WebRtcTestBase::GetUserMediaWithSpecificConstraintsAndAccept(
content::WebContents* tab_contents,
const std::string& constraints) const {
- InfoBar* infobar = GetUserMediaAndWaitForInfoBar(tab_contents, constraints);
- infobar->delegate()->AsConfirmInfoBarDelegate()->Accept();
+ MediaStreamInfoBarDelegate* infobar =
+ GetUserMediaAndWaitForInfoBar(tab_contents, constraints);
+ infobar->Accept();
CloseInfoBarInTab(tab_contents, infobar);
// Wait for WebRTC to call the success callback.
@@ -56,8 +57,9 @@
void WebRtcTestBase::GetUserMediaWithSpecificConstraintsAndDeny(
content::WebContents* tab_contents,
const std::string& constraints) const {
- InfoBar* infobar = GetUserMediaAndWaitForInfoBar(tab_contents, constraints);
- infobar->delegate()->AsConfirmInfoBarDelegate()->Cancel();
+ MediaStreamInfoBarDelegate* infobar =
+ GetUserMediaAndWaitForInfoBar(tab_contents, constraints);
+ infobar->Cancel();
CloseInfoBarInTab(tab_contents, infobar);
// Wait for WebRTC to call the fail callback.
@@ -67,9 +69,9 @@
void WebRtcTestBase::GetUserMediaAndDismiss(
content::WebContents* tab_contents) const {
- InfoBar* infobar =
+ MediaStreamInfoBarDelegate* infobar =
GetUserMediaAndWaitForInfoBar(tab_contents, kAudioVideoCallConstraints);
- infobar->delegate()->InfoBarDismissed();
+ infobar->InfoBarDismissed();
CloseInfoBarInTab(tab_contents, infobar);
// A dismiss should be treated like a deny.
@@ -97,7 +99,7 @@
EXPECT_EQ("ok-requested", result);
}
-InfoBar* WebRtcTestBase::GetUserMediaAndWaitForInfoBar(
+MediaStreamInfoBarDelegate* WebRtcTestBase::GetUserMediaAndWaitForInfoBar(
content::WebContents* tab_contents,
const std::string& constraints) const {
content::WindowedNotificationObserver infobar_added(
@@ -110,8 +112,9 @@
// Wait for the bar to pop up, then return it.
infobar_added.Wait();
content::Details<InfoBar::AddedDetails> details(infobar_added.details());
- EXPECT_TRUE(details->delegate()->AsMediaStreamInfoBarDelegate());
- return details.ptr();
+ MediaStreamInfoBarDelegate* infobar = details->AsMediaStreamInfoBarDelegate();
+ EXPECT_TRUE(infobar);
+ return infobar;
}
content::WebContents* WebRtcTestBase::OpenPageAndAcceptUserMedia(
@@ -127,9 +130,10 @@
content::WebContents* tab_contents =
browser()->tab_strip_model()->GetActiveWebContents();
content::Details<InfoBar::AddedDetails> details(infobar_added.details());
- InfoBar* infobar = details.ptr();
+ MediaStreamInfoBarDelegate* infobar =
+ details->AsMediaStreamInfoBarDelegate();
EXPECT_TRUE(infobar);
- infobar->delegate()->AsMediaStreamInfoBarDelegate()->Accept();
+ infobar->Accept();
CloseInfoBarInTab(tab_contents, infobar);
return tab_contents;
@@ -137,7 +141,7 @@
void WebRtcTestBase::CloseInfoBarInTab(
content::WebContents* tab_contents,
- InfoBar* infobar) const {
+ MediaStreamInfoBarDelegate* infobar) const {
content::WindowedNotificationObserver infobar_removed(
chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
content::NotificationService::AllSources());
« no previous file with comments | « trunk/src/chrome/browser/media/webrtc_browsertest_base.h ('k') | trunk/src/chrome/browser/nacl_host/nacl_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698