OLD | NEW |
| (Empty) |
1 // Copyright (c) 2013 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. | |
4 | |
5 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | |
6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/process/process_handle.h" | |
10 #include "ppapi/c/pp_resource.h" | |
11 #include "ppapi/c/private/ppb_instance_private.h" | |
12 #include "webkit/plugins/webkit_plugins_export.h" | |
13 | |
14 class GURL; | |
15 | |
16 namespace base { | |
17 class FilePath; | |
18 } | |
19 | |
20 namespace content { | |
21 class RenderView; | |
22 } | |
23 | |
24 namespace gfx { | |
25 class ImageSkia; | |
26 class Rect; | |
27 } | |
28 | |
29 namespace ppapi { | |
30 class PpapiPermissions; | |
31 class VarTracker; | |
32 struct URLRequestInfoData; | |
33 } | |
34 | |
35 namespace IPC { | |
36 struct ChannelHandle; | |
37 } | |
38 | |
39 namespace WebKit { | |
40 class WebPluginContainer; | |
41 } | |
42 | |
43 namespace webkit { | |
44 namespace ppapi { | |
45 | |
46 class PluginInstance { | |
47 public: | |
48 static WEBKIT_PLUGINS_EXPORT PluginInstance* Get(PP_Instance instance_id); | |
49 | |
50 virtual ~PluginInstance() {} | |
51 | |
52 virtual content::RenderView* GetRenderView() = 0; | |
53 | |
54 virtual WebKit::WebPluginContainer* GetContainer() = 0; | |
55 | |
56 virtual ::ppapi::VarTracker* GetVarTracker() = 0; | |
57 | |
58 virtual const GURL& GetPluginURL() = 0; | |
59 | |
60 // Returns the location of this module. | |
61 virtual base::FilePath GetModulePath() = 0; | |
62 | |
63 // Returns a reference to a file with the given path. | |
64 // The returned object will have a refcount of 0 (just like "new"). | |
65 virtual PP_Resource CreateExternalFileReference( | |
66 const base::FilePath& external_file_path) = 0; | |
67 | |
68 // Creates a PPB_ImageData given a Skia image. | |
69 virtual PP_Resource CreateImage(gfx::ImageSkia* source_image, | |
70 float scale) = 0; | |
71 | |
72 // Switches this instance with one that uses the out of process IPC proxy. | |
73 virtual PP_ExternalPluginResult SwitchToOutOfProcessProxy( | |
74 const base::FilePath& file_path, | |
75 ::ppapi::PpapiPermissions permissions, | |
76 const IPC::ChannelHandle& channel_handle, | |
77 base::ProcessId plugin_pid, | |
78 int plugin_child_id) = 0; | |
79 | |
80 // Set this to true if plugin thinks it will always be on top. This allows us | |
81 // to use a more optimized painting path in some cases. | |
82 virtual void SetAlwaysOnTop(bool on_top) = 0; | |
83 | |
84 // Returns true iff the plugin is a full-page plugin (i.e. not in an iframe | |
85 // or embedded in a page). | |
86 virtual bool IsFullPagePlugin() = 0; | |
87 | |
88 // Switches between fullscreen and normal mode. If |delay_report| is set to | |
89 // false, it may report the new state through DidChangeView immediately. If | |
90 // true, it will delay it. When called from the plugin, delay_report should | |
91 // be true to avoid re-entrancy. | |
92 virtual void FlashSetFullscreen(bool fullscreen, bool delay_report) = 0; | |
93 | |
94 virtual bool IsRectTopmost(const gfx::Rect& rect) = 0; | |
95 | |
96 virtual int32_t Navigate(const ::ppapi::URLRequestInfoData& request, | |
97 const char* target, | |
98 bool from_user_action) = 0; | |
99 | |
100 }; | |
101 | |
102 } // namespace ppapi | |
103 } // namespace webkit | |
104 | |
105 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | |
OLD | NEW |