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

Unified Diff: chrome/browser/ui/browser.cc

Issue 10692113: Wire up GetUserMedia in Chrome Frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moved media thread changes to issue 10744002 Created 8 years, 5 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
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/views/external_tab_container_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 029e9b96ab05f8cd8a36c32541c34ff5dd8af7dc..8e0f32ac464e83b6fb7598ea3005bc606883c6f8 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -955,6 +955,36 @@ void Browser::FindReplyHelper(WebContents* web_contents,
final_update);
}
+// static
+void Browser::RequestMediaAccessPermissionHelper(
+ content::WebContents* web_contents,
+ const content::MediaStreamRequest* request,
+ const content::MediaResponseCallback& callback) {
+ TabContents* tab = TabContents::FromWebContents(web_contents);
+
+ scoped_ptr<MediaStreamDevicesController>
+ controller(new MediaStreamDevicesController(tab->profile(),
+ request,
+ callback));
+ if (!controller->DismissInfoBarAndTakeActionOnSettings()) {
+ InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper();
+ InfoBarDelegate* old_infobar = NULL;
+ for (size_t i = 0; i < infobar_helper->infobar_count(); ++i) {
+ old_infobar = infobar_helper->GetInfoBarDelegateAt(i)->
+ AsMediaStreamInfoBarDelegate();
+ if (old_infobar)
+ break;
+ }
+
+ InfoBarDelegate* infobar =
+ new MediaStreamInfoBarDelegate(infobar_helper, controller.release());
+ if (old_infobar)
+ infobar_helper->ReplaceInfoBar(old_infobar, infobar);
+ else
+ infobar_helper->AddInfoBar(infobar);
+ }
+}
+
void Browser::UpdateUIForNavigationInTab(TabContents* contents,
content::PageTransition transition,
bool user_initiated) {
@@ -1912,30 +1942,7 @@ void Browser::RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest* request,
const content::MediaResponseCallback& callback) {
- TabContents* tab = TabContents::FromWebContents(web_contents);
- DCHECK(tab);
-
- scoped_ptr<MediaStreamDevicesController>
- controller(new MediaStreamDevicesController(tab->profile(),
- request,
- callback));
- if (!controller->DismissInfoBarAndTakeActionOnSettings()) {
- InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper();
- InfoBarDelegate* old_infobar = NULL;
- for (size_t i = 0; i < infobar_helper->infobar_count(); ++i) {
- old_infobar = infobar_helper->GetInfoBarDelegateAt(i)->
- AsMediaStreamInfoBarDelegate();
- if (old_infobar)
- break;
- }
-
- InfoBarDelegate* infobar =
- new MediaStreamInfoBarDelegate(infobar_helper, controller.release());
- if (old_infobar)
- infobar_helper->ReplaceInfoBar(old_infobar, infobar);
- else
- infobar_helper->AddInfoBar(infobar);
- }
+ RequestMediaAccessPermissionHelper(web_contents, request, callback);
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/views/external_tab_container_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698