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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 10537099: add "always allow" option to the mediastream infobar and allow user to allow/not allow acces to devi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/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() {

Powered by Google App Engine
This is Rietveld 408576698