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

Unified Diff: chrome/browser/ui/cocoa/infobars/media_stream_infobar_controller.mm

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: addressed sky's comment and replaced "Do not allow any site to" with "Do not allow sites to" 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/cocoa/infobars/media_stream_infobar_controller.mm
diff --git a/chrome/browser/ui/cocoa/infobars/media_stream_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/media_stream_infobar_controller.mm
index cfdd5ee8221a893aad26fce594fffefa273d779d..2bcc58de65678e8b0224391fe1aa393844b427b2 100644
--- a/chrome/browser/ui/cocoa/infobars/media_stream_infobar_controller.mm
+++ b/chrome/browser/ui/cocoa/infobars/media_stream_infobar_controller.mm
@@ -100,9 +100,10 @@ void SizeAndPlaceControl(NSView* toModify, NSView* anchor, bool after) {
content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, &audioId);
deviceMenuModel_->GetSelectedDeviceId(
content::MEDIA_STREAM_DEVICE_TYPE_VIDEO_CAPTURE, &videoId);
+ bool alwaysAllow = deviceMenuModel_->always_allow();
- static_cast<MediaStreamInfoBarDelegate*>([self delegate])->Accept(audioId,
- videoId);
+ static_cast<MediaStreamInfoBarDelegate*>([self delegate])->Accept(
+ audioId, videoId, alwaysAllow);
// Remove the infobar, we're done.
[super removeSelf];
@@ -165,12 +166,12 @@ void SizeAndPlaceControl(NSView* toModify, NSView* anchor, bool after) {
// Get the requested media type(s) and add corresponding text to the text
// field.
- int messageId = IDS_MEDIA_CAPTURE_MIC_AND_VIDEO;
- DCHECK(delegate->has_audio() || delegate->has_video());
- if (!delegate->has_audio())
+ int messageId = IDS_MEDIA_CAPTURE_AUDIO_AND_VIDEO;
+ DCHECK(delegate->HasAudio() || delegate->HasVideo());
+ if (!delegate->HasAudio())
messageId = IDS_MEDIA_CAPTURE_VIDEO_ONLY;
- else if (!delegate->has_video())
- messageId = IDS_MEDIA_CAPTURE_MIC_ONLY;
+ else if (!delegate->HasVideo())
+ messageId = IDS_MEDIA_CAPTURE_AUDIO_ONLY;
string16 securityOrigin = UTF8ToUTF16(delegate->GetSecurityOrigin().spec());
NSString* text = l10n_util::GetNSStringF(messageId, securityOrigin);

Powered by Google App Engine
This is Rietveld 408576698