| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/content_settings/content_settings_provider.h" | 10 #include "chrome/browser/content_settings/content_settings_provider.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 if (webcam_requested_ && | 61 if (webcam_requested_ && |
| 62 GetDevicePolicy(prefs::kVideoCaptureAllowed) == ALWAYS_DENY) { | 62 GetDevicePolicy(prefs::kVideoCaptureAllowed) == ALWAYS_DENY) { |
| 63 webcam_requested_ = false; | 63 webcam_requested_ = false; |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| 67 MediaStreamDevicesController::~MediaStreamDevicesController() {} | 67 MediaStreamDevicesController::~MediaStreamDevicesController() {} |
| 68 | 68 |
| 69 // static | 69 // static |
| 70 void MediaStreamDevicesController::RegisterUserPrefs( | 70 void MediaStreamDevicesController::RegisterUserPrefs( |
| 71 PrefRegistrySyncable* prefs) { | 71 user_prefs::PrefRegistrySyncable* prefs) { |
| 72 prefs->RegisterBooleanPref(prefs::kVideoCaptureAllowed, | 72 prefs->RegisterBooleanPref(prefs::kVideoCaptureAllowed, |
| 73 true, | 73 true, |
| 74 PrefRegistrySyncable::UNSYNCABLE_PREF); | 74 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 75 prefs->RegisterBooleanPref(prefs::kAudioCaptureAllowed, | 75 prefs->RegisterBooleanPref(prefs::kAudioCaptureAllowed, |
| 76 true, | 76 true, |
| 77 PrefRegistrySyncable::UNSYNCABLE_PREF); | 77 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 78 } | 78 } |
| 79 | 79 |
| 80 | 80 |
| 81 bool MediaStreamDevicesController::DismissInfoBarAndTakeActionOnSettings() { | 81 bool MediaStreamDevicesController::DismissInfoBarAndTakeActionOnSettings() { |
| 82 // If this is a no UI check for policies only go straight to accept - policy | 82 // If this is a no UI check for policies only go straight to accept - policy |
| 83 // check will be done automatically on the way. | 83 // check will be done automatically on the way. |
| 84 if (request_.request_type == content::MEDIA_OPEN_DEVICE) { | 84 if (request_.request_type == content::MEDIA_OPEN_DEVICE) { |
| 85 Accept(false); | 85 Accept(false); |
| 86 return true; | 86 return true; |
| 87 } | 87 } |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 } | 309 } |
| 310 if (webcam_requested_) { | 310 if (webcam_requested_) { |
| 311 profile_->GetHostContentSettingsMap()->SetContentSetting( | 311 profile_->GetHostContentSettingsMap()->SetContentSetting( |
| 312 primary_pattern, | 312 primary_pattern, |
| 313 ContentSettingsPattern::Wildcard(), | 313 ContentSettingsPattern::Wildcard(), |
| 314 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, | 314 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
| 315 std::string(), | 315 std::string(), |
| 316 content_setting); | 316 content_setting); |
| 317 } | 317 } |
| 318 } | 318 } |
| OLD | NEW |