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_NPAPI_WEBPLUGIN_DELEGATE_PROXY_H_ | 5 #ifndef CONTENT_RENDERER_NPAPI_WEBPLUGIN_DELEGATE_PROXY_H_ |
6 #define CONTENT_RENDERER_NPAPI_WEBPLUGIN_DELEGATE_PROXY_H_ | 6 #define CONTENT_RENDERER_NPAPI_WEBPLUGIN_DELEGATE_PROXY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 struct _NPP* GetPluginNPP() override; | 73 struct _NPP* GetPluginNPP() override; |
74 bool GetFormValue(base::string16* value) override; | 74 bool GetFormValue(base::string16* value) override; |
75 void SetFocus(bool focused) override; | 75 void SetFocus(bool focused) override; |
76 bool HandleInputEvent(const blink::WebInputEvent& event, | 76 bool HandleInputEvent(const blink::WebInputEvent& event, |
77 WebCursor::CursorInfo* cursor) override; | 77 WebCursor::CursorInfo* cursor) override; |
78 int GetProcessId() override; | 78 int GetProcessId() override; |
79 | 79 |
80 // Informs the plugin that its containing content view has gained or lost | 80 // Informs the plugin that its containing content view has gained or lost |
81 // first responder status. | 81 // first responder status. |
82 virtual void SetContentAreaFocus(bool has_focus); | 82 virtual void SetContentAreaFocus(bool has_focus); |
| 83 #if defined(OS_WIN) |
| 84 // Informs the plugin that plugin IME has updated its status. |
| 85 virtual void ImeCompositionUpdated( |
| 86 const base::string16& text, |
| 87 const std::vector<int>& clauses, |
| 88 const std::vector<int>& target, |
| 89 int cursor_position, |
| 90 int plugin_id); |
| 91 // Informs the plugin that plugin IME has completed. |
| 92 // If |text| is empty, composition was cancelled. |
| 93 virtual void ImeCompositionCompleted(const base::string16& text, |
| 94 int plugin_id); |
| 95 #endif |
83 #if defined(OS_MACOSX) | 96 #if defined(OS_MACOSX) |
84 // Informs the plugin that its enclosing window has gained or lost focus. | 97 // Informs the plugin that its enclosing window has gained or lost focus. |
85 virtual void SetWindowFocus(bool window_has_focus); | 98 virtual void SetWindowFocus(bool window_has_focus); |
86 // Informs the plugin that its container (window/tab) has changed visibility. | 99 // Informs the plugin that its container (window/tab) has changed visibility. |
87 virtual void SetContainerVisibility(bool is_visible); | 100 virtual void SetContainerVisibility(bool is_visible); |
88 // Informs the plugin that its enclosing window's frame has changed. | 101 // Informs the plugin that its enclosing window's frame has changed. |
89 virtual void WindowFrameChanged(gfx::Rect window_frame, gfx::Rect view_frame); | 102 virtual void WindowFrameChanged(gfx::Rect window_frame, gfx::Rect view_frame); |
90 // Informs the plugin that plugin IME has completed. | 103 // Informs the plugin that plugin IME has completed. |
91 // If |text| is empty, composition was cancelled. | 104 // If |text| is empty, composition was cancelled. |
92 virtual void ImeCompositionCompleted(const base::string16& text, | 105 virtual void ImeCompositionCompleted(const base::string16& text, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 #if defined(OS_MACOSX) | 149 #if defined(OS_MACOSX) |
137 void OnFocusChanged(bool focused); | 150 void OnFocusChanged(bool focused); |
138 void OnStartIme(); | 151 void OnStartIme(); |
139 // Accelerated (Core Animation) plugin implementation. | 152 // Accelerated (Core Animation) plugin implementation. |
140 void OnAcceleratedPluginEnabledRendering(); | 153 void OnAcceleratedPluginEnabledRendering(); |
141 void OnAcceleratedPluginAllocatedIOSurface(int32_t width, | 154 void OnAcceleratedPluginAllocatedIOSurface(int32_t width, |
142 int32_t height, | 155 int32_t height, |
143 uint32_t surface_id); | 156 uint32_t surface_id); |
144 void OnAcceleratedPluginSwappedIOSurface(); | 157 void OnAcceleratedPluginSwappedIOSurface(); |
145 #endif | 158 #endif |
| 159 #if defined(OS_WIN) |
| 160 void OnSetWindowlessData(HANDLE modal_loop_pump_messages_event_handle, |
| 161 gfx::NativeViewId dummy_activation_window); |
| 162 void OnNotifyIMEStatus(const int input_mode, const gfx::Rect& caret_rect); |
| 163 #endif |
146 // Helper function that sends the UpdateGeometry message. | 164 // Helper function that sends the UpdateGeometry message. |
147 void SendUpdateGeometry(bool bitmaps_changed); | 165 void SendUpdateGeometry(bool bitmaps_changed); |
148 | 166 |
149 // Copies the given rectangle from the back-buffer transport_stores_ bitmap to | 167 // Copies the given rectangle from the back-buffer transport_stores_ bitmap to |
150 // the front-buffer transport_stores_ bitmap. | 168 // the front-buffer transport_stores_ bitmap. |
151 void CopyFromBackBufferToFrontBuffer(const gfx::Rect& rect); | 169 void CopyFromBackBufferToFrontBuffer(const gfx::Rect& rect); |
152 | 170 |
153 // Updates the front-buffer with the given rectangle from the back-buffer, | 171 // Updates the front-buffer with the given rectangle from the back-buffer, |
154 // either by copying the rectangle or flipping the buffers. | 172 // either by copying the rectangle or flipping the buffers. |
155 void UpdateFrontBuffer(const gfx::Rect& rect, bool allow_buffer_flipping); | 173 void UpdateFrontBuffer(const gfx::Rect& rect, bool allow_buffer_flipping); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // Returns true if we should update the plugin geometry synchronously. | 219 // Returns true if we should update the plugin geometry synchronously. |
202 bool UseSynchronousGeometryUpdates(); | 220 bool UseSynchronousGeometryUpdates(); |
203 #endif | 221 #endif |
204 | 222 |
205 base::WeakPtr<RenderViewImpl> render_view_; | 223 base::WeakPtr<RenderViewImpl> render_view_; |
206 RenderFrameImpl* render_frame_; | 224 RenderFrameImpl* render_frame_; |
207 WebPluginImpl* plugin_; | 225 WebPluginImpl* plugin_; |
208 bool uses_shared_bitmaps_; | 226 bool uses_shared_bitmaps_; |
209 #if defined(OS_MACOSX) | 227 #if defined(OS_MACOSX) |
210 bool uses_compositor_; | 228 bool uses_compositor_; |
| 229 #elif defined(OS_WIN) |
| 230 // Used for windowless plugins so that keyboard activation works. |
| 231 gfx::NativeViewId dummy_activation_window_; |
211 #endif | 232 #endif |
212 scoped_refptr<PluginChannelHost> channel_host_; | 233 scoped_refptr<PluginChannelHost> channel_host_; |
213 std::string mime_type_; | 234 std::string mime_type_; |
214 int instance_id_; | 235 int instance_id_; |
215 WebPluginInfo info_; | 236 WebPluginInfo info_; |
216 | 237 |
217 gfx::Rect plugin_rect_; | 238 gfx::Rect plugin_rect_; |
218 gfx::Rect clip_rect_; | 239 gfx::Rect clip_rect_; |
219 | 240 |
220 NPObject* npobject_; | 241 NPObject* npobject_; |
221 | 242 |
222 // Dummy NPP used to uniquely identify this plugin. | 243 // Dummy NPP used to uniquely identify this plugin. |
223 scoped_ptr<NPP_t> npp_; | 244 scoped_ptr<NPP_t> npp_; |
224 | 245 |
| 246 // Event passed in by the plugin process and is used to decide if messages |
| 247 // need to be pumped in the NPP_HandleEvent sync call. |
| 248 scoped_ptr<base::WaitableEvent> modal_loop_pump_messages_event_; |
| 249 |
225 // Bitmap for crashed plugin | 250 // Bitmap for crashed plugin |
226 SkBitmap* sad_plugin_; | 251 SkBitmap* sad_plugin_; |
227 | 252 |
228 // True if we got an invalidate from the plugin and are waiting for a paint. | 253 // True if we got an invalidate from the plugin and are waiting for a paint. |
229 bool invalidate_pending_; | 254 bool invalidate_pending_; |
230 | 255 |
231 // If the plugin is transparent or not. | 256 // If the plugin is transparent or not. |
232 bool transparent_; | 257 bool transparent_; |
233 | 258 |
234 // The index in the transport_stores_ array of the current front buffer | 259 // The index in the transport_stores_ array of the current front buffer |
(...skipping 10 matching lines...) Expand all Loading... |
245 | 270 |
246 // The url of the main frame hosting the plugin. | 271 // The url of the main frame hosting the plugin. |
247 GURL page_url_; | 272 GURL page_url_; |
248 | 273 |
249 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy); | 274 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy); |
250 }; | 275 }; |
251 | 276 |
252 } // namespace content | 277 } // namespace content |
253 | 278 |
254 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_DELEGATE_PROXY_H_ | 279 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_DELEGATE_PROXY_H_ |
OLD | NEW |