| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 DesktopMediaPicker::DoneCallback callback = base::Bind( | 208 DesktopMediaPicker::DoneCallback callback = base::Bind( |
| 209 &DesktopCaptureChooseDesktopMediaFunction::OnPickerDialogResults, this); | 209 &DesktopCaptureChooseDesktopMediaFunction::OnPickerDialogResults, this); |
| 210 | 210 |
| 211 picker_->Show(parent_window, parent_window, | 211 picker_->Show(parent_window, parent_window, |
| 212 base::UTF8ToUTF16(GetExtension()->name()), | 212 base::UTF8ToUTF16(GetExtension()->name()), |
| 213 target_name, | 213 target_name, |
| 214 media_list.Pass(), callback); | 214 media_list.Pass(), callback); |
| 215 return true; | 215 return true; |
| 216 } | 216 } |
| 217 | 217 |
| 218 void DesktopCaptureChooseDesktopMediaFunction::WebContentsDestroyed( | 218 void DesktopCaptureChooseDesktopMediaFunction::WebContentsDestroyed() { |
| 219 content::WebContents* web_contents) { | |
| 220 Cancel(); | 219 Cancel(); |
| 221 } | 220 } |
| 222 | 221 |
| 223 void DesktopCaptureChooseDesktopMediaFunction::OnPickerDialogResults( | 222 void DesktopCaptureChooseDesktopMediaFunction::OnPickerDialogResults( |
| 224 content::DesktopMediaID source) { | 223 content::DesktopMediaID source) { |
| 225 std::string result; | 224 std::string result; |
| 226 if (source.type != content::DesktopMediaID::TYPE_NONE) { | 225 if (source.type != content::DesktopMediaID::TYPE_NONE) { |
| 227 DesktopStreamsRegistry* registry = | 226 DesktopStreamsRegistry* registry = |
| 228 MediaCaptureDevicesDispatcher::GetInstance()-> | 227 MediaCaptureDevicesDispatcher::GetInstance()-> |
| 229 GetDesktopStreamsRegistry(); | 228 GetDesktopStreamsRegistry(); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 291 |
| 293 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, | 292 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, |
| 294 int request_id) { | 293 int request_id) { |
| 295 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); | 294 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); |
| 296 if (it != requests_.end()) | 295 if (it != requests_.end()) |
| 297 it->second->Cancel(); | 296 it->second->Cancel(); |
| 298 } | 297 } |
| 299 | 298 |
| 300 | 299 |
| 301 } // namespace extensions | 300 } // namespace extensions |
| OLD | NEW |