| 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 results_ = api::desktop_capture::ChooseDesktopMedia::Results::Create( |
| 244 result, source.audio_share); |
| 244 SendResponse(true); | 245 SendResponse(true); |
| 245 } | 246 } |
| 246 | 247 |
| 247 DesktopCaptureRequestsRegistry::RequestId::RequestId(int process_id, | 248 DesktopCaptureRequestsRegistry::RequestId::RequestId(int process_id, |
| 248 int request_id) | 249 int request_id) |
| 249 : process_id(process_id), | 250 : process_id(process_id), |
| 250 request_id(request_id) { | 251 request_id(request_id) { |
| 251 } | 252 } |
| 252 | 253 |
| 253 bool DesktopCaptureRequestsRegistry::RequestId::operator<( | 254 bool DesktopCaptureRequestsRegistry::RequestId::operator<( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 296 |
| 296 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, | 297 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, |
| 297 int request_id) { | 298 int request_id) { |
| 298 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); | 299 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); |
| 299 if (it != requests_.end()) | 300 if (it != requests_.end()) |
| 300 it->second->Cancel(); | 301 it->second->Cancel(); |
| 301 } | 302 } |
| 302 | 303 |
| 303 | 304 |
| 304 } // namespace extensions | 305 } // namespace extensions |
| OLD | NEW |