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/mock_renderer_ppapi_host.h" | 5 #include "content/renderer/pepper/mock_renderer_ppapi_host.h" |
6 | 6 |
7 #include "content/renderer/pepper/fake_pepper_plugin_instance.h" | 7 #include "content/renderer/pepper/fake_pepper_plugin_instance.h" |
8 #include "ui/gfx/point.h" | 8 #include "ui/gfx/point.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 MockRendererPpapiHost::MockRendererPpapiHost(RenderView* render_view, | 12 MockRendererPpapiHost::MockRendererPpapiHost(RenderView* render_view, |
13 PP_Instance instance) | 13 PP_Instance instance) |
14 : sink_(), | 14 : sink_(), |
15 ppapi_host_(&sink_, ppapi::PpapiPermissions()), | 15 ppapi_host_(&sink_, ppapi::PpapiPermissions()), |
16 render_view_(render_view), | 16 render_view_(render_view), |
17 pp_instance_(instance), | 17 pp_instance_(instance), |
18 has_user_gesture_(false), | 18 has_user_gesture_(false), |
19 plugin_instance_(new FakePepperPluginInstance) { | 19 plugin_instance_(new FakePepperPluginInstance) {} |
20 } | |
21 | 20 |
22 MockRendererPpapiHost::~MockRendererPpapiHost() { | 21 MockRendererPpapiHost::~MockRendererPpapiHost() {} |
23 } | |
24 | 22 |
25 ppapi::host::PpapiHost* MockRendererPpapiHost::GetPpapiHost() { | 23 ppapi::host::PpapiHost* MockRendererPpapiHost::GetPpapiHost() { |
26 return &ppapi_host_; | 24 return &ppapi_host_; |
27 } | 25 } |
28 | 26 |
29 bool MockRendererPpapiHost::IsValidInstance(PP_Instance instance) const { | 27 bool MockRendererPpapiHost::IsValidInstance(PP_Instance instance) const { |
30 return instance == pp_instance_; | 28 return instance == pp_instance_; |
31 } | 29 } |
32 | 30 |
33 PepperPluginInstance* MockRendererPpapiHost::GetPluginInstance( | 31 PepperPluginInstance* MockRendererPpapiHost::GetPluginInstance( |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 return gfx::Point(); | 70 return gfx::Point(); |
73 } | 71 } |
74 | 72 |
75 IPC::PlatformFileForTransit MockRendererPpapiHost::ShareHandleWithRemote( | 73 IPC::PlatformFileForTransit MockRendererPpapiHost::ShareHandleWithRemote( |
76 base::PlatformFile handle, | 74 base::PlatformFile handle, |
77 bool should_close_source) { | 75 bool should_close_source) { |
78 NOTIMPLEMENTED(); | 76 NOTIMPLEMENTED(); |
79 return IPC::InvalidPlatformFileForTransit(); | 77 return IPC::InvalidPlatformFileForTransit(); |
80 } | 78 } |
81 | 79 |
82 bool MockRendererPpapiHost::IsRunningInProcess() const { | 80 bool MockRendererPpapiHost::IsRunningInProcess() const { return false; } |
83 return false; | |
84 } | |
85 | 81 |
86 void MockRendererPpapiHost::CreateBrowserResourceHosts( | 82 void MockRendererPpapiHost::CreateBrowserResourceHosts( |
87 PP_Instance instance, | 83 PP_Instance instance, |
88 const std::vector<IPC::Message>& nested_msgs, | 84 const std::vector<IPC::Message>& nested_msgs, |
89 const base::Callback<void(const std::vector<int>&)>& callback) const { | 85 const base::Callback<void(const std::vector<int>&)>& callback) const { |
90 callback.Run(std::vector<int>(nested_msgs.size(), 0)); | 86 callback.Run(std::vector<int>(nested_msgs.size(), 0)); |
91 return; | 87 return; |
92 } | 88 } |
93 | 89 |
94 GURL MockRendererPpapiHost::GetDocumentURL(PP_Instance instance) const { | 90 GURL MockRendererPpapiHost::GetDocumentURL(PP_Instance instance) const { |
95 NOTIMPLEMENTED(); | 91 NOTIMPLEMENTED(); |
96 return GURL(); | 92 return GURL(); |
97 } | 93 } |
98 | 94 |
99 } // namespace content | 95 } // namespace content |
OLD | NEW |