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_capture_devices_dispatcher.h" | 5 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
22 #include "chrome/browser/ui/browser_finder.h" | 22 #include "chrome/browser/ui/browser_finder.h" |
23 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
24 #include "chrome/browser/ui/screen_capture_notification_ui.h" | 24 #include "chrome/browser/ui/screen_capture_notification_ui.h" |
25 #include "chrome/browser/ui/simple_message_box.h" | 25 #include "chrome/browser/ui/simple_message_box.h" |
26 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 26 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/common/chrome_version_info.h" | 28 #include "chrome/common/chrome_version_info.h" |
29 #include "chrome/common/pref_names.h" | 29 #include "chrome/common/pref_names.h" |
30 #include "chrome/grit/generated_resources.h" | 30 #include "chrome/grit/generated_resources.h" |
31 #include "components/content_settings/core/browser/content_settings_provider.h" | |
32 #include "components/content_settings/core/browser/host_content_settings_map.h" | 31 #include "components/content_settings/core/browser/host_content_settings_map.h" |
33 #include "components/pref_registry/pref_registry_syncable.h" | 32 #include "components/pref_registry/pref_registry_syncable.h" |
34 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
35 #include "content/public/browser/desktop_media_id.h" | 34 #include "content/public/browser/desktop_media_id.h" |
36 #include "content/public/browser/media_capture_devices.h" | 35 #include "content/public/browser/media_capture_devices.h" |
37 #include "content/public/browser/notification_service.h" | 36 #include "content/public/browser/notification_service.h" |
38 #include "content/public/browser/notification_source.h" | 37 #include "content/public/browser/notification_source.h" |
39 #include "content/public/browser/notification_types.h" | 38 #include "content/public/browser/notification_types.h" |
40 #include "content/public/browser/render_frame_host.h" | 39 #include "content/public/browser/render_frame_host.h" |
41 #include "content/public/browser/render_process_host.h" | 40 #include "content/public/browser/render_process_host.h" |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 ALWAYS_ALLOW) { | 415 ALWAYS_ALLOW) { |
417 return true; | 416 return true; |
418 } | 417 } |
419 | 418 |
420 // There's no secondary URL for these content types, hence duplicating | 419 // There's no secondary URL for these content types, hence duplicating |
421 // |security_origin|. | 420 // |security_origin|. |
422 if (profile->GetHostContentSettingsMap()->GetContentSetting( | 421 if (profile->GetHostContentSettingsMap()->GetContentSetting( |
423 security_origin, | 422 security_origin, |
424 security_origin, | 423 security_origin, |
425 contentSettingsType, | 424 contentSettingsType, |
426 NO_RESOURCE_IDENTIFIER) == CONTENT_SETTING_ALLOW) { | 425 content_settings::ResourceIdentifier()) == CONTENT_SETTING_ALLOW) { |
427 return true; | 426 return true; |
428 } | 427 } |
429 | 428 |
430 return false; | 429 return false; |
431 } | 430 } |
432 | 431 |
433 bool MediaCaptureDevicesDispatcher::CheckMediaAccessPermission( | 432 bool MediaCaptureDevicesDispatcher::CheckMediaAccessPermission( |
434 content::WebContents* web_contents, | 433 content::WebContents* web_contents, |
435 const GURL& security_origin, | 434 const GURL& security_origin, |
436 content::MediaStreamType type) { | 435 content::MediaStreamType type) { |
(...skipping 25 matching lines...) Expand all Loading... |
462 ALWAYS_ALLOW) { | 461 ALWAYS_ALLOW) { |
463 return true; | 462 return true; |
464 } | 463 } |
465 | 464 |
466 // There's no secondary URL for these content types, hence duplicating | 465 // There's no secondary URL for these content types, hence duplicating |
467 // |security_origin|. | 466 // |security_origin|. |
468 if (profile->GetHostContentSettingsMap()->GetContentSetting( | 467 if (profile->GetHostContentSettingsMap()->GetContentSetting( |
469 security_origin, | 468 security_origin, |
470 security_origin, | 469 security_origin, |
471 contentSettingsType, | 470 contentSettingsType, |
472 NO_RESOURCE_IDENTIFIER) == CONTENT_SETTING_ALLOW) { | 471 content_settings::ResourceIdentifier()) == CONTENT_SETTING_ALLOW) { |
473 return true; | 472 return true; |
474 } | 473 } |
475 | 474 |
476 return false; | 475 return false; |
477 } | 476 } |
478 | 477 |
479 #if defined(ENABLE_EXTENSIONS) | 478 #if defined(ENABLE_EXTENSIONS) |
480 bool MediaCaptureDevicesDispatcher::CheckMediaAccessPermission( | 479 bool MediaCaptureDevicesDispatcher::CheckMediaAccessPermission( |
481 content::WebContents* web_contents, | 480 content::WebContents* web_contents, |
482 const GURL& security_origin, | 481 const GURL& security_origin, |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 | 1143 |
1145 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( | 1144 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( |
1146 const MediaStreamDevices& devices) { | 1145 const MediaStreamDevices& devices) { |
1147 test_audio_devices_ = devices; | 1146 test_audio_devices_ = devices; |
1148 } | 1147 } |
1149 | 1148 |
1150 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( | 1149 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( |
1151 const MediaStreamDevices& devices) { | 1150 const MediaStreamDevices& devices) { |
1152 test_video_devices_ = devices; | 1151 test_video_devices_ = devices; |
1153 } | 1152 } |
OLD | NEW |