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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_tab_util.h" | 8 #include "chrome/browser/extensions/extension_tab_util.h" |
9 #include "chrome/browser/media/desktop_media_list_ash.h" | 9 #include "chrome/browser/media/desktop_media_list_ash.h" |
10 #include "chrome/browser/media/desktop_streams_registry.h" | 10 #include "chrome/browser/media/desktop_streams_registry.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 show_screens ? webrtc::ScreenCapturer::Create(options) : NULL); | 121 show_screens ? webrtc::ScreenCapturer::Create(options) : NULL); |
122 scoped_ptr<webrtc::WindowCapturer> window_capturer( | 122 scoped_ptr<webrtc::WindowCapturer> window_capturer( |
123 show_windows ? webrtc::WindowCapturer::Create(options) : NULL); | 123 show_windows ? webrtc::WindowCapturer::Create(options) : NULL); |
124 | 124 |
125 media_list.reset(new NativeDesktopMediaList( | 125 media_list.reset(new NativeDesktopMediaList( |
126 screen_capturer.Pass(), window_capturer.Pass())); | 126 screen_capturer.Pass(), window_capturer.Pass())); |
127 } | 127 } |
128 | 128 |
129 // DesktopMediaPicker is implemented only for Windows, OSX and | 129 // DesktopMediaPicker is implemented only for Windows, OSX and |
130 // Aura Linux builds. | 130 // Aura Linux builds. |
131 #if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX) | 131 #if defined(TOOLKIT_VIEWS) && !defined(OS_ANDROID) || defined(OS_MACOSX) |
mfomitchev
2015/11/19 15:56:55
Note that Dan is adding a new ANDROID_JAVA_UI defi
mfomitchev
2015/11/19 15:56:55
Can you please add braces here so that it is more
bshe
2015/11/19 20:14:38
Done.
bshe
2015/11/19 20:14:38
Added a TODO.
| |
132 // TODO(bshe): This is called if chrome.desktopCapture.chooseDesktopMedia | |
133 // or chrome.webrtcDesktopCapturePrivate.chooseDesktopMedia are called by | |
134 // extensions. Simply return error message on Android platform for now. | |
135 // Revisit this when necessary. See crbug.com/557424. | |
132 picker_ = DesktopMediaPicker::Create(); | 136 picker_ = DesktopMediaPicker::Create(); |
133 #else | 137 #else |
134 error_ = "Desktop Capture API is not yet implemented for this platform."; | 138 error_ = "Desktop Capture API is not yet implemented for this platform."; |
135 return false; | 139 return false; |
136 #endif | 140 #endif |
137 } | 141 } |
138 DesktopMediaPicker::DoneCallback callback = base::Bind( | 142 DesktopMediaPicker::DoneCallback callback = base::Bind( |
139 &DesktopCaptureChooseDesktopMediaFunctionBase::OnPickerDialogResults, | 143 &DesktopCaptureChooseDesktopMediaFunctionBase::OnPickerDialogResults, |
140 this); | 144 this); |
141 | 145 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 | 236 |
233 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, | 237 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, |
234 int request_id) { | 238 int request_id) { |
235 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); | 239 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); |
236 if (it != requests_.end()) | 240 if (it != requests_.end()) |
237 it->second->Cancel(); | 241 it->second->Cancel(); |
238 } | 242 } |
239 | 243 |
240 | 244 |
241 } // namespace extensions | 245 } // namespace extensions |
OLD | NEW |