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

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

Issue 10542092: Refactor the content interface for RequestMediaAccessPermission. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up Created 8 years, 6 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 a3ec1d0eb8b4a5d3290d9edef7552d1eae5064ef..f80ddf1ff100ee40d8d9e53f620ae63a3a89050f 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -118,6 +118,7 @@
#include "chrome/browser/ui/global_error_service_factory.h"
#include "chrome/browser/ui/hung_plugin_tab_helper.h"
#include "chrome/browser/ui/intents/web_intent_picker_controller.h"
+#include "chrome/browser/ui/media_stream_infobar_delegate.h"
#include "chrome/browser/ui/omnibox/location_bar.h"
#include "chrome/browser/ui/panels/panel.h"
#include "chrome/browser/ui/panels/panel_manager.h"
@@ -3685,6 +3686,30 @@ void Browser::LostMouseLock() {
fullscreen_controller_->LostMouseLock();
}
+void Browser::RequestMediaAccessPermission(
+ content::WebContents* web_contents,
+ const content::MediaStreamRequest* request,
+ const content::MediaResponseCallback& callback) {
+ TabContentsWrapper* tab =
jochen (gone - plz use gerrit) 2012/06/09 07:55:21 TabContentsWrapper is called TabContents these day
Evan Stade 2012/06/12 00:00:46 Done.
+ TabContentsWrapper::GetCurrentWrapperForContents(web_contents);
+ DCHECK(tab);
jam 2012/06/11 05:31:57 nit: no need for dcheck, if it's null the crash in
Evan Stade 2012/06/12 00:00:46 I think of DCHECK as documentation. If we remove i
jam 2012/06/12 00:29:06 it seems that if a developer reading this assumes
+
+ InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper();
+ InfoBarDelegate* old_infobar = NULL;
+ for (size_t i = 0; i < infobar_helper->infobar_count() && !old_infobar; ++i) {
+ old_infobar =
+ infobar_helper->GetInfoBarDelegateAt(i)->AsMediaStreamInfoBarDelegate();
+ }
+
+ InfoBarDelegate* infobar = new MediaStreamInfoBarDelegate(infobar_helper,
+ request,
+ callback);
+ if (old_infobar)
+ infobar_helper->ReplaceInfoBar(old_infobar, infobar);
+ else
+ infobar_helper->AddInfoBar(infobar);
+}
+
///////////////////////////////////////////////////////////////////////////////
// Browser, CoreTabHelperDelegate implementation:

Powered by Google App Engine
This is Rietveld 408576698