| 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/desktop_capture_access_handler.h" | 5 #include "chrome/browser/media/desktop_capture_access_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "content/public/browser/render_frame_host.h" | 25 #include "content/public/browser/render_frame_host.h" |
| 26 #include "content/public/browser/render_process_host.h" | 26 #include "content/public/browser/render_process_host.h" |
| 27 #include "content/public/common/content_switches.h" | 27 #include "content/public/common/content_switches.h" |
| 28 #include "content/public/common/media_stream_request.h" | 28 #include "content/public/common/media_stream_request.h" |
| 29 #include "content/public/common/origin_util.h" | 29 #include "content/public/common/origin_util.h" |
| 30 #include "extensions/browser/app_window/app_window.h" | 30 #include "extensions/browser/app_window/app_window.h" |
| 31 #include "extensions/browser/app_window/app_window_registry.h" | 31 #include "extensions/browser/app_window/app_window_registry.h" |
| 32 #include "extensions/common/constants.h" | 32 #include "extensions/common/constants.h" |
| 33 #include "extensions/common/extension.h" | 33 #include "extensions/common/extension.h" |
| 34 #include "extensions/common/switches.h" | 34 #include "extensions/common/switches.h" |
| 35 #include "media/audio/audio_manager_base.h" | 35 #include "media/audio/audio_device_description.h" |
| 36 #include "net/base/url_util.h" | 36 #include "net/base/url_util.h" |
| 37 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_types.h" | 37 #include "third_party/webrtc/modules/desktop_capture/desktop_capture_types.h" |
| 38 #include "ui/base/l10n/l10n_util.h" | 38 #include "ui/base/l10n/l10n_util.h" |
| 39 | 39 |
| 40 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
| 41 #include "ash/shell.h" | 41 #include "ash/shell.h" |
| 42 #include "base/sha1.h" | 42 #include "base/sha1.h" |
| 43 #endif // defined(OS_CHROMEOS) | 43 #endif // defined(OS_CHROMEOS) |
| 44 | 44 |
| 45 using content::BrowserThread; | 45 using content::BrowserThread; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 content::MEDIA_DESKTOP_VIDEO_CAPTURE, media_id.ToString(), "Screen")); | 177 content::MEDIA_DESKTOP_VIDEO_CAPTURE, media_id.ToString(), "Screen")); |
| 178 if (capture_audio) { | 178 if (capture_audio) { |
| 179 if (media_id.type == content::DesktopMediaID::TYPE_WEB_CONTENTS) { | 179 if (media_id.type == content::DesktopMediaID::TYPE_WEB_CONTENTS) { |
| 180 devices->push_back( | 180 devices->push_back( |
| 181 content::MediaStreamDevice(content::MEDIA_DESKTOP_AUDIO_CAPTURE, | 181 content::MediaStreamDevice(content::MEDIA_DESKTOP_AUDIO_CAPTURE, |
| 182 media_id.ToString(), "Tab audio")); | 182 media_id.ToString(), "Tab audio")); |
| 183 } else { | 183 } else { |
| 184 // Use the special loopback device ID for system audio capture. | 184 // Use the special loopback device ID for system audio capture. |
| 185 devices->push_back(content::MediaStreamDevice( | 185 devices->push_back(content::MediaStreamDevice( |
| 186 content::MEDIA_DESKTOP_AUDIO_CAPTURE, | 186 content::MEDIA_DESKTOP_AUDIO_CAPTURE, |
| 187 media::AudioManagerBase::kLoopbackInputDeviceId, "System Audio")); | 187 media::AudioDeviceDescription::kLoopbackInputDeviceId, |
| 188 "System Audio")); |
| 188 } | 189 } |
| 189 } | 190 } |
| 190 | 191 |
| 191 // If required, register to display the notification for stream capture. | 192 // If required, register to display the notification for stream capture. |
| 192 if (!display_notification) { | 193 if (!display_notification) { |
| 193 return ui; | 194 return ui; |
| 194 } | 195 } |
| 195 | 196 |
| 196 ui = ScreenCaptureNotificationUI::Create(GetStopSharingUIString( | 197 ui = ScreenCaptureNotificationUI::Create(GetStopSharingUIString( |
| 197 application_title, registered_extension_name, capture_audio, | 198 application_title, registered_extension_name, capture_audio, |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 desktop_capture_sessions_.erase(it); | 476 desktop_capture_sessions_.erase(it); |
| 476 break; | 477 break; |
| 477 } | 478 } |
| 478 } | 479 } |
| 479 } | 480 } |
| 480 } | 481 } |
| 481 | 482 |
| 482 bool DesktopCaptureAccessHandler::IsCaptureInProgress() { | 483 bool DesktopCaptureAccessHandler::IsCaptureInProgress() { |
| 483 return desktop_capture_sessions_.size() > 0; | 484 return desktop_capture_sessions_.size() > 0; |
| 484 } | 485 } |
| OLD | NEW |