OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/pepper/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1488 MessageLoop::current()->PostTask( | 1488 MessageLoop::current()->PostTask( |
1489 FROM_HERE, | 1489 FROM_HERE, |
1490 base::Bind( | 1490 base::Bind( |
1491 &PepperDeviceEnumerationEventHandler::OnDevicesEnumerationFailed, | 1491 &PepperDeviceEnumerationEventHandler::OnDevicesEnumerationFailed, |
1492 device_enumeration_event_handler_->AsWeakPtr(), request_id)); | 1492 device_enumeration_event_handler_->AsWeakPtr(), request_id)); |
1493 #endif | 1493 #endif |
1494 | 1494 |
1495 return request_id; | 1495 return request_id; |
1496 } | 1496 } |
1497 | 1497 |
| 1498 int PepperPluginDelegateImpl::StopEnumerateDevices(int request_id) { |
| 1499 device_enumeration_event_handler_->UnregisterEnumerateDevicesCallback( |
| 1500 request_id); |
| 1501 |
| 1502 #if defined(ENABLE_WEBRTC) |
| 1503 render_view_->media_stream_dispatcher()->StopEnumerateDevices( |
| 1504 request_id, device_enumeration_event_handler_.get()->AsWeakPtr()); |
| 1505 #else |
| 1506 MessageLoop::current()->PostTask( |
| 1507 FROM_HERE, |
| 1508 base::Bind( |
| 1509 &PepperDeviceEnumerationEventHandler::OnDevicesEnumerationFailed, |
| 1510 device_enumeration_event_handler_->AsWeakPtr(), request_id)); |
| 1511 #endif |
| 1512 |
| 1513 return request_id; |
| 1514 } |
| 1515 |
1498 bool PepperPluginDelegateImpl::OnMessageReceived(const IPC::Message& message) { | 1516 bool PepperPluginDelegateImpl::OnMessageReceived(const IPC::Message& message) { |
1499 bool handled = true; | 1517 bool handled = true; |
1500 IPC_BEGIN_MESSAGE_MAP(PepperPluginDelegateImpl, message) | 1518 IPC_BEGIN_MESSAGE_MAP(PepperPluginDelegateImpl, message) |
1501 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ConnectACK, | 1519 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ConnectACK, |
1502 OnTCPSocketConnectACK) | 1520 OnTCPSocketConnectACK) |
1503 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SSLHandshakeACK, | 1521 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SSLHandshakeACK, |
1504 OnTCPSocketSSLHandshakeACK) | 1522 OnTCPSocketSSLHandshakeACK) |
1505 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ReadACK, OnTCPSocketReadACK) | 1523 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ReadACK, OnTCPSocketReadACK) |
1506 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_WriteACK, OnTCPSocketWriteACK) | 1524 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_WriteACK, OnTCPSocketWriteACK) |
1507 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_BindACK, OnUDPSocketBindACK) | 1525 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_BindACK, OnUDPSocketBindACK) |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 else | 1771 else |
1754 return render_view_->mouse_lock_dispatcher(); | 1772 return render_view_->mouse_lock_dispatcher(); |
1755 } | 1773 } |
1756 | 1774 |
1757 webkit_glue::ClipboardClient* | 1775 webkit_glue::ClipboardClient* |
1758 PepperPluginDelegateImpl::CreateClipboardClient() const { | 1776 PepperPluginDelegateImpl::CreateClipboardClient() const { |
1759 return new RendererClipboardClient; | 1777 return new RendererClipboardClient; |
1760 } | 1778 } |
1761 | 1779 |
1762 } // namespace content | 1780 } // namespace content |
OLD | NEW |