| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 // MediaCaptureDevicesDispatcher::ProcessDesktopCaptureAccessRequest(). | 233 // MediaCaptureDevicesDispatcher::ProcessDesktopCaptureAccessRequest(). |
| 234 // http://crbug.com/304341 | 234 // http://crbug.com/304341 |
| 235 content::RenderFrameHost* const main_frame = web_contents()->GetMainFrame(); | 235 content::RenderFrameHost* const main_frame = web_contents()->GetMainFrame(); |
| 236 result = registry->RegisterStream(main_frame->GetProcess()->GetID(), | 236 result = registry->RegisterStream(main_frame->GetProcess()->GetID(), |
| 237 main_frame->GetRoutingID(), | 237 main_frame->GetRoutingID(), |
| 238 origin_, | 238 origin_, |
| 239 source, | 239 source, |
| 240 extension()->name()); | 240 extension()->name()); |
| 241 } | 241 } |
| 242 | 242 |
| 243 SetResult(base::MakeUnique<base::StringValue>(result)); | 243 api::desktop_capture::ChooseDesktopMedia::Results::Options options; |
| 244 options.can_request_audio_track = source.audio_share; |
| 245 results_ = api::desktop_capture::ChooseDesktopMedia::Results::Create(result, |
| 246 options); |
| 244 SendResponse(true); | 247 SendResponse(true); |
| 245 } | 248 } |
| 246 | 249 |
| 247 DesktopCaptureRequestsRegistry::RequestId::RequestId(int process_id, | 250 DesktopCaptureRequestsRegistry::RequestId::RequestId(int process_id, |
| 248 int request_id) | 251 int request_id) |
| 249 : process_id(process_id), | 252 : process_id(process_id), |
| 250 request_id(request_id) { | 253 request_id(request_id) { |
| 251 } | 254 } |
| 252 | 255 |
| 253 bool DesktopCaptureRequestsRegistry::RequestId::operator<( | 256 bool DesktopCaptureRequestsRegistry::RequestId::operator<( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 298 |
| 296 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, | 299 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, |
| 297 int request_id) { | 300 int request_id) { |
| 298 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); | 301 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); |
| 299 if (it != requests_.end()) | 302 if (it != requests_.end()) |
| 300 it->second->Cancel(); | 303 it->second->Cancel(); |
| 301 } | 304 } |
| 302 | 305 |
| 303 | 306 |
| 304 } // namespace extensions | 307 } // namespace extensions |
| OLD | NEW |