| 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/extensions/api/desktop_capture/desktop_capture_base.h" | 5 #include "chrome/browser/extensions/api/desktop_capture/desktop_capture_base.h" |
| 6 | 6 |
| 7 #include <tuple> | 7 #include <tuple> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/extension_tab_util.h" | 10 #include "chrome/browser/extensions/extension_tab_util.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 show_screens ? webrtc::ScreenCapturer::Create(options) : NULL); | 123 show_screens ? webrtc::ScreenCapturer::Create(options) : NULL); |
| 124 scoped_ptr<webrtc::WindowCapturer> window_capturer( | 124 scoped_ptr<webrtc::WindowCapturer> window_capturer( |
| 125 show_windows ? webrtc::WindowCapturer::Create(options) : NULL); | 125 show_windows ? webrtc::WindowCapturer::Create(options) : NULL); |
| 126 | 126 |
| 127 media_list.reset(new NativeDesktopMediaList( | 127 media_list.reset(new NativeDesktopMediaList( |
| 128 screen_capturer.Pass(), window_capturer.Pass())); | 128 screen_capturer.Pass(), window_capturer.Pass())); |
| 129 } | 129 } |
| 130 | 130 |
| 131 // DesktopMediaPicker is implemented only for Windows, OSX and | 131 // DesktopMediaPicker is implemented only for Windows, OSX and |
| 132 // Aura Linux builds. | 132 // Aura Linux builds. |
| 133 // TODO(bshe): Use ANDROID_JAVA_UI flag here after it landed. | 133 #if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX) |
| 134 #if (defined(TOOLKIT_VIEWS) && !defined(OS_ANDROID)) || defined(OS_MACOSX) | |
| 135 // TODO(bshe): This is called if chrome.desktopCapture.chooseDesktopMedia | |
| 136 // or chrome.webrtcDesktopCapturePrivate.chooseDesktopMedia are called by | |
| 137 // extensions. Simply return error message on Android platform for now. | |
| 138 // Revisit this when necessary. See crbug.com/557424. | |
| 139 picker_ = DesktopMediaPicker::Create(); | 134 picker_ = DesktopMediaPicker::Create(); |
| 140 #else | 135 #else |
| 141 error_ = "Desktop Capture API is not yet implemented for this platform."; | 136 error_ = "Desktop Capture API is not yet implemented for this platform."; |
| 142 return false; | 137 return false; |
| 143 #endif | 138 #endif |
| 144 } | 139 } |
| 145 DesktopMediaPicker::DoneCallback callback = base::Bind( | 140 DesktopMediaPicker::DoneCallback callback = base::Bind( |
| 146 &DesktopCaptureChooseDesktopMediaFunctionBase::OnPickerDialogResults, | 141 &DesktopCaptureChooseDesktopMediaFunctionBase::OnPickerDialogResults, |
| 147 this); | 142 this); |
| 148 | 143 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 231 |
| 237 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, | 232 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, |
| 238 int request_id) { | 233 int request_id) { |
| 239 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); | 234 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); |
| 240 if (it != requests_.end()) | 235 if (it != requests_.end()) |
| 241 it->second->Cancel(); | 236 it->second->Cancel(); |
| 242 } | 237 } |
| 243 | 238 |
| 244 | 239 |
| 245 } // namespace extensions | 240 } // namespace extensions |
| OLD | NEW |