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