Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc

Issue 1758463002: Add browser test cases for tab and audio share, which are new functionality of desktop share. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve comment Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698