OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/webrtc/media_stream_device_permission_context.h" | 5 #include "chrome/browser/media/webrtc/media_stream_device_permission_context.h" |
6 #include "base/feature_list.h" | 6 #include "base/feature_list.h" |
7 #include "chrome/browser/media/webrtc/media_stream_device_permissions.h" | 7 #include "chrome/browser/media/webrtc/media_stream_device_permissions.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/common/chrome_features.h" | 9 #include "chrome/common/chrome_features.h" |
10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
11 #include "components/content_settings/core/browser/host_content_settings_map.h" | 11 #include "components/content_settings/core/browser/host_content_settings_map.h" |
12 #include "components/content_settings/core/common/content_settings.h" | 12 #include "components/content_settings/core/common/content_settings.h" |
| 13 #include "content/public/common/content_features.h" |
13 #include "content/public/common/url_constants.h" | 14 #include "content/public/common/url_constants.h" |
14 #include "extensions/common/constants.h" | 15 #include "extensions/common/constants.h" |
15 | 16 |
16 MediaStreamDevicePermissionContext::MediaStreamDevicePermissionContext( | 17 MediaStreamDevicePermissionContext::MediaStreamDevicePermissionContext( |
17 Profile* profile, | 18 Profile* profile, |
18 const ContentSettingsType content_settings_type) | 19 const ContentSettingsType content_settings_type) |
19 : PermissionContextBase(profile, content_settings_type), | 20 : PermissionContextBase(profile, content_settings_type), |
20 content_settings_type_(content_settings_type) { | 21 content_settings_type_(content_settings_type) { |
21 DCHECK(content_settings_type_ == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || | 22 DCHECK(content_settings_type_ == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || |
22 content_settings_type_ == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); | 23 content_settings_type_ == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 NOTREACHED() << "ResetPermission is not implemented"; | 85 NOTREACHED() << "ResetPermission is not implemented"; |
85 } | 86 } |
86 | 87 |
87 void MediaStreamDevicePermissionContext::CancelPermissionRequest( | 88 void MediaStreamDevicePermissionContext::CancelPermissionRequest( |
88 content::WebContents* web_contents, | 89 content::WebContents* web_contents, |
89 const PermissionRequestID& id) { | 90 const PermissionRequestID& id) { |
90 NOTREACHED() << "CancelPermissionRequest is not implemented"; | 91 NOTREACHED() << "CancelPermissionRequest is not implemented"; |
91 } | 92 } |
92 | 93 |
93 bool MediaStreamDevicePermissionContext::IsRestrictedToSecureOrigins() const { | 94 bool MediaStreamDevicePermissionContext::IsRestrictedToSecureOrigins() const { |
94 // Flash currently doesn't require secure origin to use mic/camera. If we | 95 return base::FeatureList::IsEnabled( |
95 // return true here, it'll break the use case like http://tinychat.com. | 96 features::kRequireSecureOriginsForPepperMediaRequests); |
96 // TODO(raymes): Change this to true after crbug.com/526324 is fixed. | |
97 return false; | |
98 } | 97 } |
OLD | NEW |