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: |