| Index: chrome/browser/ui/browser.cc
|
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
|
| index dfdd7301e24b28257b1a7abc9de10ce8a1a8b596..fc6c6f205468dba4af2b6803d1f9be06fa314443 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"
|
| @@ -3698,6 +3699,29 @@ void Browser::LostMouseLock() {
|
| fullscreen_controller_->LostMouseLock();
|
| }
|
|
|
| +void Browser::RequestMediaAccessPermission(
|
| + content::WebContents* web_contents,
|
| + const content::MediaStreamRequest* request,
|
| + const content::MediaResponseCallback& callback) {
|
| + TabContents* tab = TabContents::FromWebContents(web_contents);
|
| + DCHECK(tab);
|
| +
|
| + 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:
|
|
|
|
|