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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 if (!show_screens && !show_windows && !show_tabs) { | 114 if (!show_screens && !show_windows && !show_tabs) { |
115 error_ = kEmptySourcesListError; | 115 error_ = kEmptySourcesListError; |
116 return false; | 116 return false; |
117 } | 117 } |
118 | 118 |
119 const gfx::NativeWindow parent_window = | 119 const gfx::NativeWindow parent_window = |
120 web_contents->GetTopLevelNativeWindow(); | 120 web_contents->GetTopLevelNativeWindow(); |
121 scoped_ptr<DesktopMediaList> media_list; | 121 scoped_ptr<DesktopMediaList> media_list; |
122 if (g_picker_factory) { | 122 if (g_picker_factory) { |
123 media_list = g_picker_factory->CreateModel( | 123 media_list = g_picker_factory->CreateModel(show_screens, show_windows, |
124 show_screens, show_windows); | 124 show_tabs, request_audio); |
125 picker_ = g_picker_factory->CreatePicker(); | 125 picker_ = g_picker_factory->CreatePicker(); |
126 } else { | 126 } else { |
127 std::vector<scoped_ptr<DesktopMediaList>> media_lists; | 127 std::vector<scoped_ptr<DesktopMediaList>> media_lists; |
128 // Create a screens/windows list and push it into media_lists. | 128 // Create a screens/windows list and push it into media_lists. |
129 if (show_screens || show_windows) { | 129 if (show_screens || show_windows) { |
130 #if defined(USE_ASH) | 130 #if defined(USE_ASH) |
131 if (chrome::IsNativeWindowInAsh(parent_window)) { | 131 if (chrome::IsNativeWindowInAsh(parent_window)) { |
132 media_lists.push_back(make_scoped_ptr(new DesktopMediaListAsh( | 132 media_lists.push_back(make_scoped_ptr(new DesktopMediaListAsh( |
133 (show_screens ? DesktopMediaListAsh::SCREENS : 0) | | 133 (show_screens ? DesktopMediaListAsh::SCREENS : 0) | |
134 (show_windows ? DesktopMediaListAsh::WINDOWS : 0)))); | 134 (show_windows ? DesktopMediaListAsh::WINDOWS : 0)))); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 259 |
260 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, | 260 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, |
261 int request_id) { | 261 int request_id) { |
262 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); | 262 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); |
263 if (it != requests_.end()) | 263 if (it != requests_.end()) |
264 it->second->Cancel(); | 264 it->second->Cancel(); |
265 } | 265 } |
266 | 266 |
267 | 267 |
268 } // namespace extensions | 268 } // namespace extensions |
OLD | NEW |