| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/media/media_stream_devices_controller.h" | 5 #include "chrome/browser/media/media_stream_devices_controller.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/content_settings/content_settings_provider.h" | 8 #include "chrome/browser/content_settings/content_settings_provider.h" |
| 9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 10 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" | 10 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 has_audio_(content::IsAudioMediaType(request->audio_type) && | 49 has_audio_(content::IsAudioMediaType(request->audio_type) && |
| 50 !IsAudioDeviceBlockedByPolicy()), | 50 !IsAudioDeviceBlockedByPolicy()), |
| 51 has_video_(content::IsVideoMediaType(request->video_type) && | 51 has_video_(content::IsVideoMediaType(request->video_type) && |
| 52 !IsVideoDeviceBlockedByPolicy()) { | 52 !IsVideoDeviceBlockedByPolicy()) { |
| 53 DCHECK(request); | 53 DCHECK(request); |
| 54 } | 54 } |
| 55 | 55 |
| 56 MediaStreamDevicesController::~MediaStreamDevicesController() {} | 56 MediaStreamDevicesController::~MediaStreamDevicesController() {} |
| 57 | 57 |
| 58 // static | 58 // static |
| 59 void MediaStreamDevicesController::RegisterUserPrefs(PrefService* prefs) { | 59 void MediaStreamDevicesController::RegisterUserPrefs( |
| 60 PrefServiceSyncable* prefs) { |
| 60 prefs->RegisterBooleanPref(prefs::kVideoCaptureAllowed, | 61 prefs->RegisterBooleanPref(prefs::kVideoCaptureAllowed, |
| 61 true, | 62 true, |
| 62 PrefService::UNSYNCABLE_PREF); | 63 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 63 prefs->RegisterBooleanPref(prefs::kAudioCaptureAllowed, | 64 prefs->RegisterBooleanPref(prefs::kAudioCaptureAllowed, |
| 64 true, | 65 true, |
| 65 PrefService::UNSYNCABLE_PREF); | 66 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 66 } | 67 } |
| 67 | 68 |
| 68 | 69 |
| 69 bool MediaStreamDevicesController::DismissInfoBarAndTakeActionOnSettings() { | 70 bool MediaStreamDevicesController::DismissInfoBarAndTakeActionOnSettings() { |
| 70 if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE || | 71 if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE || |
| 71 request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE) { | 72 request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE) { |
| 72 HandleTapMediaRequest(); | 73 HandleTapMediaRequest(); |
| 73 return true; | 74 return true; |
| 74 } | 75 } |
| 75 | 76 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 } | 260 } |
| 260 if (has_video_) { | 261 if (has_video_) { |
| 261 profile_->GetHostContentSettingsMap()->SetContentSetting( | 262 profile_->GetHostContentSettingsMap()->SetContentSetting( |
| 262 primary_pattern, | 263 primary_pattern, |
| 263 ContentSettingsPattern::Wildcard(), | 264 ContentSettingsPattern::Wildcard(), |
| 264 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, | 265 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
| 265 std::string(), | 266 std::string(), |
| 266 content_setting); | 267 content_setting); |
| 267 } | 268 } |
| 268 } | 269 } |
| OLD | NEW |