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 #if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX) | 133 // TODO(bshe): Use ANDROID_JAVA_UI flag here after it landed. |
| 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. |
134 picker_ = DesktopMediaPicker::Create(); | 139 picker_ = DesktopMediaPicker::Create(); |
135 #else | 140 #else |
136 error_ = "Desktop Capture API is not yet implemented for this platform."; | 141 error_ = "Desktop Capture API is not yet implemented for this platform."; |
137 return false; | 142 return false; |
138 #endif | 143 #endif |
139 } | 144 } |
140 DesktopMediaPicker::DoneCallback callback = base::Bind( | 145 DesktopMediaPicker::DoneCallback callback = base::Bind( |
141 &DesktopCaptureChooseDesktopMediaFunctionBase::OnPickerDialogResults, | 146 &DesktopCaptureChooseDesktopMediaFunctionBase::OnPickerDialogResults, |
142 this); | 147 this); |
143 | 148 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 236 |
232 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, | 237 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, |
233 int request_id) { | 238 int request_id) { |
234 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); | 239 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); |
235 if (it != requests_.end()) | 240 if (it != requests_.end()) |
236 it->second->Cancel(); | 241 it->second->Cancel(); |
237 } | 242 } |
238 | 243 |
239 | 244 |
240 } // namespace extensions | 245 } // namespace extensions |
OLD | NEW |