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 #ifndef CONTENT_RENDERER_PEPPER_MOCK_RENDERER_PPAPI_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_MOCK_RENDERER_PPAPI_HOST_H_ |
6 #define CONTENT_RENDERER_PEPPER_MOCK_RENDERER_PPAPI_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_MOCK_RENDERER_PPAPI_HOST_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/renderer/renderer_ppapi_host.h" | 10 #include "content/public/renderer/renderer_ppapi_host.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 MockRendererPpapiHost(RenderView* render_view, PP_Instance instance); | 25 MockRendererPpapiHost(RenderView* render_view, PP_Instance instance); |
26 virtual ~MockRendererPpapiHost(); | 26 virtual ~MockRendererPpapiHost(); |
27 | 27 |
28 ppapi::proxy::ResourceMessageTestSink& sink() { return sink_; } | 28 ppapi::proxy::ResourceMessageTestSink& sink() { return sink_; } |
29 PP_Instance pp_instance() const { return pp_instance_; } | 29 PP_Instance pp_instance() const { return pp_instance_; } |
30 | 30 |
31 // Sets whether there is currently a user gesture. Defaults to false. | 31 // Sets whether there is currently a user gesture. Defaults to false. |
32 void set_has_user_gesture(bool gesture) { has_user_gesture_ = gesture; } | 32 void set_has_user_gesture(bool gesture) { has_user_gesture_ = gesture; } |
33 | 33 |
34 // RendererPpapiHost. | 34 // RendererPpapiHost. |
35 virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE; | 35 virtual ppapi::host::PpapiHost* GetPpapiHost() override; |
36 virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE; | 36 virtual bool IsValidInstance(PP_Instance instance) const override; |
37 virtual PepperPluginInstance* GetPluginInstance(PP_Instance instance) const | 37 virtual PepperPluginInstance* GetPluginInstance(PP_Instance instance) const |
38 OVERRIDE; | 38 override; |
39 virtual RenderFrame* GetRenderFrameForInstance(PP_Instance instance) const | 39 virtual RenderFrame* GetRenderFrameForInstance(PP_Instance instance) const |
40 OVERRIDE; | 40 override; |
41 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const | 41 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const |
42 OVERRIDE; | 42 override; |
43 virtual blink::WebPluginContainer* GetContainerForInstance( | 43 virtual blink::WebPluginContainer* GetContainerForInstance( |
44 PP_Instance instance) const OVERRIDE; | 44 PP_Instance instance) const override; |
45 virtual base::ProcessId GetPluginPID() const OVERRIDE; | 45 virtual base::ProcessId GetPluginPID() const override; |
46 virtual bool HasUserGesture(PP_Instance instance) const OVERRIDE; | 46 virtual bool HasUserGesture(PP_Instance instance) const override; |
47 virtual int GetRoutingIDForWidget(PP_Instance instance) const OVERRIDE; | 47 virtual int GetRoutingIDForWidget(PP_Instance instance) const override; |
48 virtual gfx::Point PluginPointToRenderFrame(PP_Instance instance, | 48 virtual gfx::Point PluginPointToRenderFrame(PP_Instance instance, |
49 const gfx::Point& pt) const | 49 const gfx::Point& pt) const |
50 OVERRIDE; | 50 override; |
51 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( | 51 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( |
52 base::PlatformFile handle, | 52 base::PlatformFile handle, |
53 bool should_close_source) OVERRIDE; | 53 bool should_close_source) override; |
54 virtual bool IsRunningInProcess() const OVERRIDE; | 54 virtual bool IsRunningInProcess() const override; |
55 virtual std::string GetPluginName() const OVERRIDE; | 55 virtual std::string GetPluginName() const override; |
56 virtual void SetToExternalPluginHost() OVERRIDE; | 56 virtual void SetToExternalPluginHost() override; |
57 virtual void CreateBrowserResourceHosts( | 57 virtual void CreateBrowserResourceHosts( |
58 PP_Instance instance, | 58 PP_Instance instance, |
59 const std::vector<IPC::Message>& nested_msgs, | 59 const std::vector<IPC::Message>& nested_msgs, |
60 const base::Callback<void(const std::vector<int>&)>& callback) const | 60 const base::Callback<void(const std::vector<int>&)>& callback) const |
61 OVERRIDE; | 61 override; |
62 virtual GURL GetDocumentURL(PP_Instance instance) const OVERRIDE; | 62 virtual GURL GetDocumentURL(PP_Instance instance) const override; |
63 | 63 |
64 private: | 64 private: |
65 ppapi::proxy::ResourceMessageTestSink sink_; | 65 ppapi::proxy::ResourceMessageTestSink sink_; |
66 ppapi::host::PpapiHost ppapi_host_; | 66 ppapi::host::PpapiHost ppapi_host_; |
67 | 67 |
68 RenderView* render_view_; | 68 RenderView* render_view_; |
69 PP_Instance pp_instance_; | 69 PP_Instance pp_instance_; |
70 | 70 |
71 bool has_user_gesture_; | 71 bool has_user_gesture_; |
72 | 72 |
73 scoped_ptr<FakePepperPluginInstance> plugin_instance_; | 73 scoped_ptr<FakePepperPluginInstance> plugin_instance_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(MockRendererPpapiHost); | 75 DISALLOW_COPY_AND_ASSIGN(MockRendererPpapiHost); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace content | 78 } // namespace content |
79 | 79 |
80 #endif // CONTENT_RENDERER_PEPPER_MOCK_RENDERER_PPAPI_HOST_H_ | 80 #endif // CONTENT_RENDERER_PEPPER_MOCK_RENDERER_PPAPI_HOST_H_ |
OLD | NEW |