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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 prefs->RegisterBooleanPref(prefs::kVideoCaptureAllowed, | 60 prefs->RegisterBooleanPref(prefs::kVideoCaptureAllowed, |
61 true, | 61 true, |
62 PrefService::UNSYNCABLE_PREF); | 62 PrefService::UNSYNCABLE_PREF); |
63 prefs->RegisterBooleanPref(prefs::kAudioCaptureAllowed, | 63 prefs->RegisterBooleanPref(prefs::kAudioCaptureAllowed, |
64 true, | 64 true, |
65 PrefService::UNSYNCABLE_PREF); | 65 PrefService::UNSYNCABLE_PREF); |
66 } | 66 } |
67 | 67 |
68 | 68 |
69 bool MediaStreamDevicesController::DismissInfoBarAndTakeActionOnSettings() { | 69 bool MediaStreamDevicesController::DismissInfoBarAndTakeActionOnSettings() { |
| 70 // If this is a no UI check for policies only go straight to accept - policy |
| 71 // check will be done automatically on the way. |
| 72 if (request_.request_type == content::MEDIA_OPEN_DEVICE) { |
| 73 Accept(false); |
| 74 return true; |
| 75 } |
| 76 |
70 if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE || | 77 if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE || |
71 request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE) { | 78 request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE) { |
72 HandleTapMediaRequest(); | 79 HandleTapMediaRequest(); |
73 return true; | 80 return true; |
74 } | 81 } |
75 | 82 |
76 // Deny the request if the security origin is empty, this happens with | 83 // Deny the request if the security origin is empty, this happens with |
77 // file access without |--allow-file-access-from-files| flag. | 84 // file access without |--allow-file-access-from-files| flag. |
78 if (request_.security_origin.is_empty()) { | 85 if (request_.security_origin.is_empty()) { |
79 Deny(false); | 86 Deny(false); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 266 } |
260 if (has_video_) { | 267 if (has_video_) { |
261 profile_->GetHostContentSettingsMap()->SetContentSetting( | 268 profile_->GetHostContentSettingsMap()->SetContentSetting( |
262 primary_pattern, | 269 primary_pattern, |
263 ContentSettingsPattern::Wildcard(), | 270 ContentSettingsPattern::Wildcard(), |
264 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, | 271 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
265 std::string(), | 272 std::string(), |
266 content_setting); | 273 content_setting); |
267 } | 274 } |
268 } | 275 } |
OLD | NEW |