| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_api.h" | 5 #include "chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/extension_tab_util.h" | 10 #include "chrome/browser/extensions/extension_tab_util.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 DesktopMediaPicker::DoneCallback callback = base::Bind( | 209 DesktopMediaPicker::DoneCallback callback = base::Bind( |
| 210 &DesktopCaptureChooseDesktopMediaFunction::OnPickerDialogResults, this); | 210 &DesktopCaptureChooseDesktopMediaFunction::OnPickerDialogResults, this); |
| 211 | 211 |
| 212 picker_->Show(parent_window, parent_window, | 212 picker_->Show(parent_window, parent_window, |
| 213 base::UTF8ToUTF16(GetExtension()->name()), | 213 base::UTF8ToUTF16(GetExtension()->name()), |
| 214 target_name, | 214 target_name, |
| 215 media_list.Pass(), callback); | 215 media_list.Pass(), callback); |
| 216 return true; | 216 return true; |
| 217 } | 217 } |
| 218 | 218 |
| 219 void DesktopCaptureChooseDesktopMediaFunction::WebContentsDestroyed( | 219 void DesktopCaptureChooseDesktopMediaFunction::WebContentsDestroyed() { |
| 220 content::WebContents* web_contents) { | |
| 221 Cancel(); | 220 Cancel(); |
| 222 } | 221 } |
| 223 | 222 |
| 224 void DesktopCaptureChooseDesktopMediaFunction::OnPickerDialogResults( | 223 void DesktopCaptureChooseDesktopMediaFunction::OnPickerDialogResults( |
| 225 content::DesktopMediaID source) { | 224 content::DesktopMediaID source) { |
| 226 std::string result; | 225 std::string result; |
| 227 if (source.type != content::DesktopMediaID::TYPE_NONE) { | 226 if (source.type != content::DesktopMediaID::TYPE_NONE) { |
| 228 DesktopStreamsRegistry* registry = | 227 DesktopStreamsRegistry* registry = |
| 229 MediaCaptureDevicesDispatcher::GetInstance()-> | 228 MediaCaptureDevicesDispatcher::GetInstance()-> |
| 230 GetDesktopStreamsRegistry(); | 229 GetDesktopStreamsRegistry(); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 292 |
| 294 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, | 293 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, |
| 295 int request_id) { | 294 int request_id) { |
| 296 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); | 295 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); |
| 297 if (it != requests_.end()) | 296 if (it != requests_.end()) |
| 298 it->second->Cancel(); | 297 it->second->Cancel(); |
| 299 } | 298 } |
| 300 | 299 |
| 301 | 300 |
| 302 } // namespace extensions | 301 } // namespace extensions |
| OLD | NEW |