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
3 // found in the LICENSE file.
5 #include "content/renderer/pepper/mock_renderer_ppapi_host.h"
7 #include "ui/gfx/point.h"
11 MockRendererPpapiHost::MockRendererPpapiHost(RenderView
* render_view
,
14 ppapi_host_(&sink_
, ppapi::PpapiPermissions()),
15 render_view_(render_view
),
16 pp_instance_(instance
),
17 has_user_gesture_(false) {
20 MockRendererPpapiHost::~MockRendererPpapiHost() {
23 ppapi::host::PpapiHost
* MockRendererPpapiHost::GetPpapiHost() {
27 bool MockRendererPpapiHost::IsValidInstance(PP_Instance instance
) const {
28 return instance
== pp_instance_
;
31 webkit::ppapi::PluginInstance
* MockRendererPpapiHost::GetPluginInstance(
32 PP_Instance instance
) const {
37 RenderView
* MockRendererPpapiHost::GetRenderViewForInstance(
38 PP_Instance instance
) const {
39 if (instance
== pp_instance_
)
44 WebKit::WebPluginContainer
* MockRendererPpapiHost::GetContainerForInstance(
45 PP_Instance instance
) const {
50 webkit::ppapi::PluginDelegate::PlatformGraphics2D
*
51 MockRendererPpapiHost::GetPlatformGraphics2D(PP_Resource resource
) {
56 bool MockRendererPpapiHost::HasUserGesture(PP_Instance instance
) const {
57 return has_user_gesture_
;
60 int MockRendererPpapiHost::GetRoutingIDForWidget(PP_Instance instance
) const {
64 gfx::Point
MockRendererPpapiHost::PluginPointToRenderView(
66 const gfx::Point
& pt
) const {
70 IPC::PlatformFileForTransit
MockRendererPpapiHost::ShareHandleWithRemote(
71 base::PlatformFile handle
,
72 bool should_close_source
) {
74 return IPC::InvalidPlatformFileForTransit();
77 bool MockRendererPpapiHost::IsRunningInProcess() const {
82 } // namespace content