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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 render_frame_host()->GetProcess()->GetID(), request_id_); | 60 render_frame_host()->GetProcess()->GetID(), request_id_); |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 void DesktopCaptureChooseDesktopMediaFunctionBase::Cancel() { | 64 void DesktopCaptureChooseDesktopMediaFunctionBase::Cancel() { |
65 // Keep reference to |this| to ensure the object doesn't get destroyed before | 65 // Keep reference to |this| to ensure the object doesn't get destroyed before |
66 // we return. | 66 // we return. |
67 scoped_refptr<DesktopCaptureChooseDesktopMediaFunctionBase> self(this); | 67 scoped_refptr<DesktopCaptureChooseDesktopMediaFunctionBase> self(this); |
68 if (picker_) { | 68 if (picker_) { |
69 picker_.reset(); | 69 picker_.reset(); |
70 SetResult(base::MakeUnique<base::StringValue>(std::string())); | 70 SetResult(base::MakeUnique<base::Value>(std::string())); |
71 SendResponse(true); | 71 SendResponse(true); |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
75 bool DesktopCaptureChooseDesktopMediaFunctionBase::Execute( | 75 bool DesktopCaptureChooseDesktopMediaFunctionBase::Execute( |
76 const std::vector<api::desktop_capture::DesktopCaptureSourceType>& sources, | 76 const std::vector<api::desktop_capture::DesktopCaptureSourceType>& sources, |
77 content::WebContents* web_contents, | 77 content::WebContents* web_contents, |
78 const GURL& origin, | 78 const GURL& origin, |
79 const base::string16 target_name) { | 79 const base::string16 target_name) { |
80 // Register to be notified when the tab is closed. | 80 // Register to be notified when the tab is closed. |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 | 298 |
299 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, | 299 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, |
300 int request_id) { | 300 int request_id) { |
301 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); | 301 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); |
302 if (it != requests_.end()) | 302 if (it != requests_.end()) |
303 it->second->Cancel(); | 303 it->second->Cancel(); |
304 } | 304 } |
305 | 305 |
306 | 306 |
307 } // namespace extensions | 307 } // namespace extensions |
OLD | NEW |