| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ |
| 6 #define WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ | 6 #define WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 virtual const gfx::Rect& GetClipRect() const { return clip_rect_; } | 88 virtual const gfx::Rect& GetClipRect() const { return clip_rect_; } |
| 89 virtual int GetQuirks() const { return quirks_; } | 89 virtual int GetQuirks() const { return quirks_; } |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 friend class DeleteTask<WebPluginDelegateImpl>; | 92 friend class DeleteTask<WebPluginDelegateImpl>; |
| 93 | 93 |
| 94 WebPluginDelegateImpl(gfx::PluginWindowHandle containing_view, | 94 WebPluginDelegateImpl(gfx::PluginWindowHandle containing_view, |
| 95 NPAPI::PluginInstance *instance); | 95 NPAPI::PluginInstance *instance); |
| 96 ~WebPluginDelegateImpl(); | 96 ~WebPluginDelegateImpl(); |
| 97 | 97 |
| 98 #if !defined(OS_MACOSX) |
| 98 //-------------------------- | 99 //-------------------------- |
| 99 // used for windowed plugins | 100 // used for windowed plugins |
| 100 void WindowedUpdateGeometry(const gfx::Rect& window_rect, | 101 void WindowedUpdateGeometry(const gfx::Rect& window_rect, |
| 101 const gfx::Rect& clip_rect); | 102 const gfx::Rect& clip_rect); |
| 102 // Create the native window. | 103 // Create the native window. |
| 103 // Returns true if the window is created (or already exists). | 104 // Returns true if the window is created (or already exists). |
| 104 // Returns false if unable to create the window. | 105 // Returns false if unable to create the window. |
| 105 bool WindowedCreatePlugin(); | 106 bool WindowedCreatePlugin(); |
| 106 | 107 |
| 107 // Destroy the native window. | 108 // Destroy the native window. |
| 108 void WindowedDestroyWindow(); | 109 void WindowedDestroyWindow(); |
| 109 | 110 |
| 110 // Reposition the native window to be in sync with the given geometry. | 111 // Reposition the native window to be in sync with the given geometry. |
| 111 // Returns true if the native window has moved or been clipped differently. | 112 // Returns true if the native window has moved or been clipped differently. |
| 112 bool WindowedReposition(const gfx::Rect& window_rect, | 113 bool WindowedReposition(const gfx::Rect& window_rect, |
| 113 const gfx::Rect& clip_rect); | 114 const gfx::Rect& clip_rect); |
| 114 | 115 |
| 115 // Tells the plugin about the current state of the window. | 116 // Tells the plugin about the current state of the window. |
| 116 // See NPAPI NPP_SetWindow for more information. | 117 // See NPAPI NPP_SetWindow for more information. |
| 117 void WindowedSetWindow(); | 118 void WindowedSetWindow(); |
| 119 #endif |
| 118 | 120 |
| 119 #if defined(OS_WIN) | 121 #if defined(OS_WIN) |
| 120 // Registers the window class for our window | 122 // Registers the window class for our window |
| 121 ATOM RegisterNativeWindowClass(); | 123 ATOM RegisterNativeWindowClass(); |
| 122 | 124 |
| 123 // Our WndProc functions. | 125 // Our WndProc functions. |
| 124 static LRESULT CALLBACK DummyWindowProc( | 126 static LRESULT CALLBACK DummyWindowProc( |
| 125 HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); | 127 HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); |
| 126 static LRESULT CALLBACK NativeWndProc( | 128 static LRESULT CALLBACK NativeWndProc( |
| 127 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); | 129 HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 146 void WindowlessSetWindow(bool force_set_window); | 148 void WindowlessSetWindow(bool force_set_window); |
| 147 | 149 |
| 148 //----------------------------------------- | 150 //----------------------------------------- |
| 149 // used for windowed and windowless plugins | 151 // used for windowed and windowless plugins |
| 150 | 152 |
| 151 NPAPI::PluginInstance* instance() { return instance_.get(); } | 153 NPAPI::PluginInstance* instance() { return instance_.get(); } |
| 152 | 154 |
| 153 // Closes down and destroys our plugin instance. | 155 // Closes down and destroys our plugin instance. |
| 154 void DestroyInstance(); | 156 void DestroyInstance(); |
| 155 | 157 |
| 158 #if !defined(OS_MACOSX) |
| 156 // used for windowed plugins | 159 // used for windowed plugins |
| 157 gfx::PluginWindowHandle windowed_handle_; | 160 gfx::PluginWindowHandle windowed_handle_; |
| 158 bool windowed_did_set_window_; | 161 bool windowed_did_set_window_; |
| 159 #if defined(OS_WIN) | |
| 160 gfx::Rect windowed_last_pos_; | 162 gfx::Rect windowed_last_pos_; |
| 161 #endif | 163 #endif |
| 162 | 164 |
| 163 // this is an optimization to avoid calling SetWindow to the plugin | 165 // this is an optimization to avoid calling SetWindow to the plugin |
| 164 // when it is not necessary. Initially, we need to call SetWindow, | 166 // when it is not necessary. Initially, we need to call SetWindow, |
| 165 // and after that we only need to call it when the geometry changes. | 167 // and after that we only need to call it when the geometry changes. |
| 166 // use this flag to indicate whether we really need it or not. | 168 // use this flag to indicate whether we really need it or not. |
| 167 bool windowless_needs_set_window_; | 169 bool windowless_needs_set_window_; |
| 168 | 170 |
| 169 // used by windowed and windowless plugins | 171 // used by windowed and windowless plugins |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 274 |
| 273 // Holds the current cursor set by the windowless plugin. | 275 // Holds the current cursor set by the windowless plugin. |
| 274 WebCursor current_windowless_cursor_; | 276 WebCursor current_windowless_cursor_; |
| 275 | 277 |
| 276 friend class WebPluginDelegate; | 278 friend class WebPluginDelegate; |
| 277 | 279 |
| 278 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateImpl); | 280 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateImpl); |
| 279 }; | 281 }; |
| 280 | 282 |
| 281 #endif // #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ | 283 #endif // #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |