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

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: 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
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 029e9b96ab05f8cd8a36c32541c34ff5dd8af7dc..f1c07a0be677a74ea7ae41a0aefb0d9ce0fda677 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -955,6 +955,37 @@ 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);
+ DCHECK(tab);
tommi (sloooow) - chröme 2012/07/06 22:17:09 nit: dcheck not needed since tab is dereferenced a
grt (UTC plus 2) 2012/07/06 23:07:25 Done.
+
+ 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 +1943,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);
}
///////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698