| Index: chrome/browser/chrome_content_browser_client.cc
|
| diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
|
| index 9cc0a79944806e2daa6dd7185fed86358a6b6f59..f30884eb2f63612b1b1f3b40aa8f7e58adda390d 100644
|
| --- a/chrome/browser/chrome_content_browser_client.cc
|
| +++ b/chrome/browser/chrome_content_browser_client.cc
|
| @@ -1125,13 +1125,17 @@ void ChromeContentBrowserClient::RequestMediaAccessPermission(
|
| 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);
|
| + scoped_ptr<MediaStreamInfoBarDelegate>
|
| + infobar(new MediaStreamInfoBarDelegate(infobar_helper,
|
| + tab->profile(),
|
| + request,
|
| + callback));
|
| + if (infobar->ShouldShowInfoBar()) {
|
| + if (old_infobar)
|
| + infobar_helper->ReplaceInfoBar(old_infobar, infobar.release());
|
| + else
|
| + infobar_helper->AddInfoBar(infobar.release());
|
| + }
|
| }
|
|
|
| content::MediaObserver* ChromeContentBrowserClient::GetMediaObserver() {
|
|
|