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

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 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
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_base.h ('k') | chrome/browser/nacl_host/nacl_infobar_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/webrtc_browsertest_base.cc
===================================================================
--- chrome/browser/media/webrtc_browsertest_base.cc (revision 238220)
+++ chrome/browser/media/webrtc_browsertest_base.cc (working copy)
@@ -38,9 +38,8 @@
void WebRtcTestBase::GetUserMediaWithSpecificConstraintsAndAccept(
content::WebContents* tab_contents,
const std::string& constraints) const {
- 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.
@@ -57,9 +56,8 @@
void WebRtcTestBase::GetUserMediaWithSpecificConstraintsAndDeny(
content::WebContents* tab_contents,
const std::string& constraints) const {
- 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.
@@ -69,9 +67,9 @@
void WebRtcTestBase::GetUserMediaAndDismiss(
content::WebContents* tab_contents) const {
- 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.
@@ -99,7 +97,7 @@
EXPECT_EQ("ok-requested", result);
}
-MediaStreamInfoBarDelegate* WebRtcTestBase::GetUserMediaAndWaitForInfoBar(
+InfoBar* WebRtcTestBase::GetUserMediaAndWaitForInfoBar(
content::WebContents* tab_contents,
const std::string& constraints) const {
content::WindowedNotificationObserver infobar_added(
@@ -112,9 +110,8 @@
// Wait for the bar to pop up, then return it.
infobar_added.Wait();
content::Details<InfoBar::AddedDetails> details(infobar_added.details());
- MediaStreamInfoBarDelegate* infobar = details->AsMediaStreamInfoBarDelegate();
- EXPECT_TRUE(infobar);
- return infobar;
+ EXPECT_TRUE(details->delegate()->AsMediaStreamInfoBarDelegate());
+ return details.ptr();
}
content::WebContents* WebRtcTestBase::OpenPageAndAcceptUserMedia(
@@ -130,10 +127,9 @@
content::WebContents* tab_contents =
browser()->tab_strip_model()->GetActiveWebContents();
content::Details<InfoBar::AddedDetails> details(infobar_added.details());
- MediaStreamInfoBarDelegate* infobar =
- details->AsMediaStreamInfoBarDelegate();
+ InfoBar* infobar = details.ptr();
EXPECT_TRUE(infobar);
- infobar->Accept();
+ infobar->delegate()->AsMediaStreamInfoBarDelegate()->Accept();
CloseInfoBarInTab(tab_contents, infobar);
return tab_contents;
@@ -141,7 +137,7 @@
void WebRtcTestBase::CloseInfoBarInTab(
content::WebContents* tab_contents,
- MediaStreamInfoBarDelegate* infobar) const {
+ InfoBar* infobar) const {
content::WindowedNotificationObserver infobar_removed(
chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
content::NotificationService::AllSources());
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_base.h ('k') | chrome/browser/nacl_host/nacl_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698