OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_H_ | |
6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/callback.h" | |
12 #include "base/memory/ref_counted.h" | |
13 #include "base/memory/shared_memory.h" | |
14 #include "base/message_loop/message_loop_proxy.h" | |
15 #include "base/platform_file.h" | |
16 #include "base/process/process.h" | |
17 #include "base/time/time.h" | |
18 #include "content/common/content_export.h" | |
19 #include "ipc/ipc_platform_file.h" | |
20 #include "ppapi/c/dev/pp_video_dev.h" | |
21 #include "ppapi/c/pp_completion_callback.h" | |
22 #include "ppapi/c/pp_errors.h" | |
23 #include "ppapi/c/pp_file_info.h" | |
24 #include "ppapi/c/pp_instance.h" | |
25 #include "ppapi/c/pp_resource.h" | |
26 #include "ppapi/c/pp_stdint.h" | |
27 #include "ppapi/c/private/ppb_flash.h" | |
28 #include "ppapi/c/private/ppb_udp_socket_private.h" | |
29 #include "ppapi/shared_impl/dir_contents.h" | |
30 #include "ui/gfx/size.h" | |
31 #include "url/gurl.h" | |
32 #include "webkit/common/fileapi/file_system_types.h" | |
33 | |
34 class GURL; | |
35 class SkCanvas; | |
36 class TransportDIB; | |
37 struct PP_NetAddress_Private; | |
38 | |
39 namespace IPC { | |
40 struct ChannelHandle; | |
41 } | |
42 | |
43 namespace WebKit { | |
44 class WebGraphicsContext3D; | |
45 } | |
46 | |
47 namespace base { | |
48 class MessageLoopProxy; | |
49 class Time; | |
50 } | |
51 | |
52 namespace content { | |
53 class RendererPpapiHost; | |
54 } | |
55 | |
56 namespace fileapi { | |
57 struct DirectoryEntry; | |
58 } | |
59 | |
60 namespace gfx { | |
61 class Point; | |
62 } | |
63 | |
64 namespace ppapi { | |
65 class PepperFilePath; | |
66 class PpapiPermissions; | |
67 class SocketOptionData; | |
68 struct DeviceRefData; | |
69 struct HostPortPair; | |
70 | |
71 } // namespace ppapi | |
72 | |
73 namespace WebKit { | |
74 typedef SkCanvas WebCanvas; | |
75 class WebGamepads; | |
76 struct WebCursorInfo; | |
77 struct WebURLError; | |
78 class WebURLLoaderClient; | |
79 class WebURLResponse; | |
80 } | |
81 | |
82 namespace content { | |
83 | |
84 class FileIO; | |
85 class FullscreenContainer; | |
86 class PepperPluginInstanceImpl; | |
87 class PluginModule; | |
88 class PPB_Flash_Menu_Impl; | |
89 class PPB_ImageData_Impl; | |
90 class PPB_TCPSocket_Private_Impl; | |
91 | |
92 // Virtual interface that the browser implements to implement features for | |
93 // PPAPI plugins. | |
94 class PluginDelegate { | |
95 public: | |
96 // Notification that the given plugin is focused or unfocused. | |
97 virtual void PluginFocusChanged(PepperPluginInstanceImpl* instance, | |
98 bool focused) = 0; | |
99 // Notification that the text input status of the given plugin is changed. | |
100 virtual void PluginTextInputTypeChanged( | |
101 PepperPluginInstanceImpl* instance) = 0; | |
102 // Notification that the caret position in the given plugin is changed. | |
103 virtual void PluginCaretPositionChanged( | |
104 PepperPluginInstanceImpl* instance) = 0; | |
105 // Notification that the plugin requested to cancel the current composition. | |
106 virtual void PluginRequestedCancelComposition( | |
107 PepperPluginInstanceImpl* instance) = 0; | |
108 // Notification that the text selection in the given plugin is changed. | |
109 virtual void PluginSelectionChanged(PepperPluginInstanceImpl* instance) = 0; | |
110 | |
111 // Indicates that the given instance has been created. | |
112 virtual void InstanceCreated(PepperPluginInstanceImpl* instance) = 0; | |
113 | |
114 // Indicates that the given instance is being destroyed. This is called from | |
115 // the destructor, so it's important that the instance is not dereferenced | |
116 // from this call. | |
117 virtual void InstanceDeleted(PepperPluginInstanceImpl* instance) = 0; | |
118 | |
119 // Sends an async IPC to open a local file. | |
120 typedef base::Callback<void (base::PlatformFileError, base::PassPlatformFile)> | |
121 AsyncOpenFileCallback; | |
122 virtual bool AsyncOpenFile(const base::FilePath& path, | |
123 int flags, | |
124 const AsyncOpenFileCallback& callback) = 0; | |
125 | |
126 // Returns a MessageLoopProxy instance associated with the message loop | |
127 // of the file thread in this renderer. | |
128 virtual scoped_refptr<base::MessageLoopProxy> | |
129 GetFileThreadMessageLoopProxy() = 0; | |
130 | |
131 // Retrieve current gamepad data. | |
132 virtual void SampleGamepads(WebKit::WebGamepads* data) = 0; | |
133 | |
134 // Notifies the plugin of the document load. This should initiate the call to | |
135 // PPP_Instance.HandleDocumentLoad. | |
136 // | |
137 // The loader object should set itself on the PluginInstance as the document | |
138 // loader using set_document_loader. | |
139 virtual void HandleDocumentLoad(PepperPluginInstanceImpl* instance, | |
140 const WebKit::WebURLResponse& response) = 0; | |
141 | |
142 // Sets up the renderer host and out-of-process proxy for an external plugin | |
143 // module. Returns the renderer host, or NULL if it couldn't be created. | |
144 virtual RendererPpapiHost* CreateExternalPluginModule( | |
145 scoped_refptr<PluginModule> module, | |
146 const base::FilePath& path, | |
147 ::ppapi::PpapiPermissions permissions, | |
148 const IPC::ChannelHandle& channel_handle, | |
149 base::ProcessId plugin_pid, | |
150 int plugin_child_id) = 0; | |
151 }; | |
152 | |
153 } // namespace content | |
154 | |
155 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_H_ | |
OLD | NEW |