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

Unified Diff: chrome/browser/ui/views/infobars/media_stream_infobar.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: 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/views/infobars/media_stream_infobar.cc
diff --git a/chrome/browser/ui/views/infobars/media_stream_infobar.cc b/chrome/browser/ui/views/infobars/media_stream_infobar.cc
index 3e29544767aa97f09817e7428c92cf07c14e37a3..1b615568217da49c3c2cc568e89064a342f1d6c9 100644
--- a/chrome/browser/ui/views/infobars/media_stream_infobar.cc
+++ b/chrome/browser/ui/views/infobars/media_stream_infobar.cc
@@ -62,12 +62,12 @@ void MediaStreamInfoBar::ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child) {
if (is_add && child == this && (label_ == NULL)) {
- int message_id = IDS_MEDIA_CAPTURE_MIC_AND_VIDEO;
- DCHECK(GetDelegate()->has_audio() || GetDelegate()->has_video());
- if (!GetDelegate()->has_audio())
+ int message_id = IDS_MEDIA_CAPTURE_AUDIO_AND_VIDEO;
+ DCHECK(GetDelegate()->HasAudio() || GetDelegate()->HasVideo());
+ if (!GetDelegate()->HasAudio())
message_id = IDS_MEDIA_CAPTURE_VIDEO_ONLY;
- else if (!GetDelegate()->has_video())
- message_id = IDS_MEDIA_CAPTURE_MIC_ONLY;
+ else if (!GetDelegate()->HasVideo())
+ message_id = IDS_MEDIA_CAPTURE_AUDIO_ONLY;
label_ = CreateLabel(l10n_util::GetStringFUTF16(message_id,
UTF8ToUTF16(GetDelegate()->GetSecurityOrigin().spec())));
@@ -101,7 +101,8 @@ void MediaStreamInfoBar::ButtonPressed(views::Button* sender,
content::MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE, &audio_id);
devices_menu_model_.GetSelectedDeviceId(
content::MEDIA_STREAM_DEVICE_TYPE_VIDEO_CAPTURE, &video_id);
- GetDelegate()->Accept(audio_id, video_id);
+ bool always_allow = devices_menu_model_.always_allow();
+ GetDelegate()->Accept(audio_id, video_id, always_allow);
RemoveSelf();
} else if (sender == deny_button_) {
GetDelegate()->Deny();
« no previous file with comments | « chrome/browser/ui/media_stream_infobar_delegate.cc ('k') | chrome/browser/ui/webui/options2/content_settings_handler2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698