Chromium Code Reviews| 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()) == |
| 426 CONTENT_SETTING_ALLOW) { | |
|
perkj_chrome
2015/04/08 10:51:15
is it clang format that does this? git cl format?
| |
| 427 return true; | 427 return true; |
| 428 } | 428 } |
| 429 | 429 |
| 430 return false; | 430 return false; |
| 431 } | 431 } |
| 432 | 432 |
| 433 bool MediaCaptureDevicesDispatcher::CheckMediaAccessPermission( | 433 bool MediaCaptureDevicesDispatcher::CheckMediaAccessPermission( |
| 434 content::WebContents* web_contents, | 434 content::WebContents* web_contents, |
| 435 const GURL& security_origin, | 435 const GURL& security_origin, |
| 436 content::MediaStreamType type) { | 436 content::MediaStreamType type) { |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 462 ALWAYS_ALLOW) { | 462 ALWAYS_ALLOW) { |
| 463 return true; | 463 return true; |
| 464 } | 464 } |
| 465 | 465 |
| 466 // There's no secondary URL for these content types, hence duplicating | 466 // There's no secondary URL for these content types, hence duplicating |
| 467 // |security_origin|. | 467 // |security_origin|. |
| 468 if (profile->GetHostContentSettingsMap()->GetContentSetting( | 468 if (profile->GetHostContentSettingsMap()->GetContentSetting( |
| 469 security_origin, | 469 security_origin, |
| 470 security_origin, | 470 security_origin, |
| 471 contentSettingsType, | 471 contentSettingsType, |
| 472 NO_RESOURCE_IDENTIFIER) == CONTENT_SETTING_ALLOW) { | 472 content_settings::ResourceIdentifier()) == |
| 473 CONTENT_SETTING_ALLOW) { | |
| 473 return true; | 474 return true; |
| 474 } | 475 } |
| 475 | 476 |
| 476 return false; | 477 return false; |
| 477 } | 478 } |
| 478 | 479 |
| 479 #if defined(ENABLE_EXTENSIONS) | 480 #if defined(ENABLE_EXTENSIONS) |
| 480 bool MediaCaptureDevicesDispatcher::CheckMediaAccessPermission( | 481 bool MediaCaptureDevicesDispatcher::CheckMediaAccessPermission( |
| 481 content::WebContents* web_contents, | 482 content::WebContents* web_contents, |
| 482 const GURL& security_origin, | 483 const GURL& security_origin, |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1144 | 1145 |
| 1145 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( | 1146 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( |
| 1146 const MediaStreamDevices& devices) { | 1147 const MediaStreamDevices& devices) { |
| 1147 test_audio_devices_ = devices; | 1148 test_audio_devices_ = devices; |
| 1148 } | 1149 } |
| 1149 | 1150 |
| 1150 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( | 1151 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( |
| 1151 const MediaStreamDevices& devices) { | 1152 const MediaStreamDevices& devices) { |
| 1152 test_video_devices_ = devices; | 1153 test_video_devices_ = devices; |
| 1153 } | 1154 } |
| OLD | NEW |