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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 webkit::ppapi::PPB_Broker_Impl* client) { | 922 webkit::ppapi::PPB_Broker_Impl* client) { |
923 DCHECK(client); | 923 DCHECK(client); |
924 | 924 |
925 webkit::ppapi::PluginModule* plugin_module = | 925 webkit::ppapi::PluginModule* plugin_module = |
926 webkit::ppapi::ResourceHelper::GetPluginModule(client); | 926 webkit::ppapi::ResourceHelper::GetPluginModule(client); |
927 if (!plugin_module) | 927 if (!plugin_module) |
928 return NULL; | 928 return NULL; |
929 | 929 |
930 scoped_refptr<PepperBrokerImpl> broker = | 930 scoped_refptr<PepperBrokerImpl> broker = |
931 static_cast<PepperBrokerImpl*>(plugin_module->GetBroker()); | 931 static_cast<PepperBrokerImpl*>(plugin_module->GetBroker()); |
932 if (!broker.get()) { | 932 if (!broker) { |
933 broker = CreateBroker(plugin_module); | 933 broker = CreateBroker(plugin_module); |
934 if (!broker.get()) | 934 if (!broker) |
935 return NULL; | 935 return NULL; |
936 } | 936 } |
937 | 937 |
938 int request_id = pending_permission_requests_.Add( | 938 int request_id = pending_permission_requests_.Add( |
939 new base::WeakPtr<webkit::ppapi::PPB_Broker_Impl>(client->AsWeakPtr())); | 939 new base::WeakPtr<webkit::ppapi::PPB_Broker_Impl>(client->AsWeakPtr())); |
940 if (!render_view_->Send( | 940 if (!render_view_->Send( |
941 new ViewHostMsg_RequestPpapiBrokerPermission( | 941 new ViewHostMsg_RequestPpapiBrokerPermission( |
942 render_view_->routing_id(), | 942 render_view_->routing_id(), |
943 request_id, | 943 request_id, |
944 client->GetDocumentUrl(), | 944 client->GetDocumentUrl(), |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 void PepperPluginDelegateImpl::DidReceiveMouseEvent( | 1372 void PepperPluginDelegateImpl::DidReceiveMouseEvent( |
1373 webkit::ppapi::PluginInstance* instance) { | 1373 webkit::ppapi::PluginInstance* instance) { |
1374 last_mouse_event_target_ = instance; | 1374 last_mouse_event_target_ = instance; |
1375 } | 1375 } |
1376 | 1376 |
1377 bool PepperPluginDelegateImpl::IsInFullscreenMode() { | 1377 bool PepperPluginDelegateImpl::IsInFullscreenMode() { |
1378 return render_view_->is_fullscreen(); | 1378 return render_view_->is_fullscreen(); |
1379 } | 1379 } |
1380 | 1380 |
1381 void PepperPluginDelegateImpl::SampleGamepads(WebKit::WebGamepads* data) { | 1381 void PepperPluginDelegateImpl::SampleGamepads(WebKit::WebGamepads* data) { |
1382 if (!gamepad_shared_memory_reader_.get()) | 1382 if (!gamepad_shared_memory_reader_) |
1383 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); | 1383 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); |
1384 gamepad_shared_memory_reader_->SampleGamepads(*data); | 1384 gamepad_shared_memory_reader_->SampleGamepads(*data); |
1385 } | 1385 } |
1386 | 1386 |
1387 bool PepperPluginDelegateImpl::IsPageVisible() const { | 1387 bool PepperPluginDelegateImpl::IsPageVisible() const { |
1388 return !render_view_->is_hidden(); | 1388 return !render_view_->is_hidden(); |
1389 } | 1389 } |
1390 | 1390 |
1391 int PepperPluginDelegateImpl::EnumerateDevices( | 1391 int PepperPluginDelegateImpl::EnumerateDevices( |
1392 PP_DeviceType_Dev type, | 1392 PP_DeviceType_Dev type, |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1643 should_close_source); | 1643 should_close_source); |
1644 } | 1644 } |
1645 | 1645 |
1646 bool PepperPluginDelegateImpl::IsRunningInProcess(PP_Instance instance) const { | 1646 bool PepperPluginDelegateImpl::IsRunningInProcess(PP_Instance instance) const { |
1647 RendererPpapiHostImpl* host = | 1647 RendererPpapiHostImpl* host = |
1648 RendererPpapiHostImpl::GetForPPInstance(instance); | 1648 RendererPpapiHostImpl::GetForPPInstance(instance); |
1649 return host && host->IsRunningInProcess(); | 1649 return host && host->IsRunningInProcess(); |
1650 } | 1650 } |
1651 | 1651 |
1652 } // namespace content | 1652 } // namespace content |
OLD | NEW |