| 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_helper_impl.h" | 5 #include "content/renderer/pepper/pepper_helper_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 14 matching lines...) Expand all Loading... |
| 25 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 25 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 26 #include "content/common/pepper_messages.h" | 26 #include "content/common/pepper_messages.h" |
| 27 #include "content/common/view_messages.h" | 27 #include "content/common/view_messages.h" |
| 28 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
| 29 #include "content/public/common/context_menu_params.h" | 29 #include "content/public/common/context_menu_params.h" |
| 30 #include "content/public/common/media_stream_request.h" | 30 #include "content/public/common/media_stream_request.h" |
| 31 #include "content/public/common/page_zoom.h" | 31 #include "content/public/common/page_zoom.h" |
| 32 #include "content/public/common/referrer.h" | 32 #include "content/public/common/referrer.h" |
| 33 #include "content/public/common/webplugininfo.h" | 33 #include "content/public/common/webplugininfo.h" |
| 34 #include "content/public/renderer/content_renderer_client.h" | 34 #include "content/public/renderer/content_renderer_client.h" |
| 35 #include "content/renderer/gamepad_shared_memory_reader.h" | |
| 36 #include "content/renderer/media/media_stream_dispatcher.h" | 35 #include "content/renderer/media/media_stream_dispatcher.h" |
| 37 #include "content/renderer/p2p/socket_dispatcher.h" | 36 #include "content/renderer/p2p/socket_dispatcher.h" |
| 38 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h" | 37 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h" |
| 39 #include "content/renderer/pepper/host_dispatcher_wrapper.h" | 38 #include "content/renderer/pepper/host_dispatcher_wrapper.h" |
| 40 #include "content/renderer/pepper/host_globals.h" | 39 #include "content/renderer/pepper/host_globals.h" |
| 41 #include "content/renderer/pepper/pepper_broker.h" | 40 #include "content/renderer/pepper/pepper_broker.h" |
| 42 #include "content/renderer/pepper/pepper_browser_connection.h" | 41 #include "content/renderer/pepper/pepper_browser_connection.h" |
| 43 #include "content/renderer/pepper/pepper_file_system_host.h" | 42 #include "content/renderer/pepper/pepper_file_system_host.h" |
| 44 #include "content/renderer/pepper/pepper_graphics_2d_host.h" | 43 #include "content/renderer/pepper/pepper_graphics_2d_host.h" |
| 45 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" | 44 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 // input for a while. | 623 // input for a while. |
| 625 if (instance == last_mouse_event_target_) | 624 if (instance == last_mouse_event_target_) |
| 626 render_view_->didChangeCursor(cursor); | 625 render_view_->didChangeCursor(cursor); |
| 627 } | 626 } |
| 628 | 627 |
| 629 void PepperHelperImpl::DidReceiveMouseEvent( | 628 void PepperHelperImpl::DidReceiveMouseEvent( |
| 630 PepperPluginInstanceImpl* instance) { | 629 PepperPluginInstanceImpl* instance) { |
| 631 last_mouse_event_target_ = instance; | 630 last_mouse_event_target_ = instance; |
| 632 } | 631 } |
| 633 | 632 |
| 634 void PepperHelperImpl::SampleGamepads(WebKit::WebGamepads* data) { | |
| 635 if (!gamepad_shared_memory_reader_) | |
| 636 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); | |
| 637 gamepad_shared_memory_reader_->SampleGamepads(*data); | |
| 638 } | |
| 639 | |
| 640 bool PepperHelperImpl::OnMessageReceived(const IPC::Message& message) { | 633 bool PepperHelperImpl::OnMessageReceived(const IPC::Message& message) { |
| 641 bool handled = true; | 634 bool handled = true; |
| 642 IPC_BEGIN_MESSAGE_MAP(PepperHelperImpl, message) | 635 IPC_BEGIN_MESSAGE_MAP(PepperHelperImpl, message) |
| 643 IPC_MESSAGE_HANDLER(ViewMsg_PpapiBrokerChannelCreated, | 636 IPC_MESSAGE_HANDLER(ViewMsg_PpapiBrokerChannelCreated, |
| 644 OnPpapiBrokerChannelCreated) | 637 OnPpapiBrokerChannelCreated) |
| 645 IPC_MESSAGE_HANDLER(ViewMsg_PpapiBrokerPermissionResult, | 638 IPC_MESSAGE_HANDLER(ViewMsg_PpapiBrokerPermissionResult, |
| 646 OnPpapiBrokerPermissionResult) | 639 OnPpapiBrokerPermissionResult) |
| 647 IPC_MESSAGE_UNHANDLED(handled = false) | 640 IPC_MESSAGE_UNHANDLED(handled = false) |
| 648 IPC_END_MESSAGE_MAP() | 641 IPC_END_MESSAGE_MAP() |
| 649 return handled; | 642 return handled; |
| 650 } | 643 } |
| 651 | 644 |
| 652 void PepperHelperImpl::OnDestruct() { | 645 void PepperHelperImpl::OnDestruct() { |
| 653 // Nothing to do here. Default implementation in RenderViewObserver does | 646 // Nothing to do here. Default implementation in RenderViewObserver does |
| 654 // 'delete this' but it's not suitable for PepperHelperImpl because | 647 // 'delete this' but it's not suitable for PepperHelperImpl because |
| 655 // it's non-pointer member in RenderViewImpl. | 648 // it's non-pointer member in RenderViewImpl. |
| 656 } | 649 } |
| 657 | 650 |
| 658 } // namespace content | 651 } // namespace content |
| OLD | NEW |