Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Side by Side Diff: webkit/glue/plugins/webplugin_delegate_impl.h

Issue 1612: Implement "iframe shim" behavior for windowed plugins.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <string> 8 #include <string>
9 #include <list> 9 #include <list>
10 10
(...skipping 23 matching lines...) Expand all
34 34
35 // WebPluginDelegate implementation 35 // WebPluginDelegate implementation
36 virtual void PluginDestroyed(); 36 virtual void PluginDestroyed();
37 virtual bool Initialize(const GURL& url, 37 virtual bool Initialize(const GURL& url,
38 char** argn, 38 char** argn,
39 char** argv, 39 char** argv,
40 int argc, 40 int argc,
41 WebPlugin* plugin, 41 WebPlugin* plugin,
42 bool load_manually); 42 bool load_manually);
43 virtual void UpdateGeometry(const gfx::Rect& window_rect, 43 virtual void UpdateGeometry(const gfx::Rect& window_rect,
44 const gfx::Rect& clip_rect, bool visible); 44 const gfx::Rect& clip_rect,
45 const std::vector<gfx::Rect>& cutout_rects,
46 bool visible);
45 virtual void Paint(HDC hdc, const gfx::Rect& rect); 47 virtual void Paint(HDC hdc, const gfx::Rect& rect);
46 virtual void Print(HDC hdc); 48 virtual void Print(HDC hdc);
47 virtual void SetFocus(); // only called when windowless 49 virtual void SetFocus(); // only called when windowless
48 // only called when windowless 50 // only called when windowless
49 virtual bool HandleEvent(NPEvent* event, 51 virtual bool HandleEvent(NPEvent* event,
50 WebCursor* cursor); 52 WebCursor* cursor);
51 virtual NPObject* GetPluginScriptableObject(); 53 virtual NPObject* GetPluginScriptableObject();
52 virtual void DidFinishLoadWithReason(NPReason reason); 54 virtual void DidFinishLoadWithReason(NPReason reason);
53 virtual int GetProcessId(); 55 virtual int GetProcessId();
54 56
(...skipping 30 matching lines...) Expand all
85 PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY = 4, 87 PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY = 4,
86 PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY = 8, 88 PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY = 8,
87 PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES = 16, 89 PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES = 16,
88 }; 90 };
89 91
90 int quirks() { return quirks_; } 92 int quirks() { return quirks_; }
91 93
92 static void MoveWindow(HWND window, 94 static void MoveWindow(HWND window,
93 const gfx::Rect& window_rect, 95 const gfx::Rect& window_rect,
94 const gfx::Rect& clip_rect, 96 const gfx::Rect& clip_rect,
97 const std::vector<gfx::Rect>& cutout_rects,
95 bool visible); 98 bool visible);
96 99
97 private: 100 private:
98 WebPluginDelegateImpl(HWND containing_window, 101 WebPluginDelegateImpl(HWND containing_window,
99 NPAPI::PluginInstance *instance); 102 NPAPI::PluginInstance *instance);
100 ~WebPluginDelegateImpl(); 103 ~WebPluginDelegateImpl();
101 104
102 //-------------------------- 105 //--------------------------
103 // used for windowed plugins 106 // used for windowed plugins
104 void WindowedUpdateGeometry(const gfx::Rect& window_rect, 107 void WindowedUpdateGeometry(const gfx::Rect& window_rect,
105 const gfx::Rect& clip_rect, bool visible); 108 const gfx::Rect& clip_rect,
109 const std::vector<gfx::Rect>& cutout_rects,
110 bool visible);
106 // Create the native window. 111 // Create the native window.
107 // Returns true if the window is created (or already exists). 112 // Returns true if the window is created (or already exists).
108 // Returns false if unable to create the window. 113 // Returns false if unable to create the window.
109 bool WindowedCreatePlugin(); 114 bool WindowedCreatePlugin();
110 115
111 // Destroy the native window. 116 // Destroy the native window.
112 void WindowedDestroyWindow(); 117 void WindowedDestroyWindow();
113 118
114 // Reposition the native window to be in sync with the given geometry. 119 // Reposition the native window to be in sync with the given geometry.
115 // Returns true if the native window has moved or been clipped differently. 120 // Returns true if the native window has moved or been clipped differently.
116 bool WindowedReposition(const gfx::Rect& window_rect, 121 bool WindowedReposition(const gfx::Rect& window_rect,
117 const gfx::Rect& clip_rect, bool visible); 122 const gfx::Rect& clip_rect,
123 const std::vector<gfx::Rect>& cutout_rects,
124 bool visible);
118 125
119 // Tells the plugin about the current state of the window. 126 // Tells the plugin about the current state of the window.
120 // See NPAPI NPP_SetWindow for more information. 127 // See NPAPI NPP_SetWindow for more information.
121 void WindowedSetWindow(); 128 void WindowedSetWindow();
122 129
123 // Registers the window class for our window 130 // Registers the window class for our window
124 ATOM RegisterNativeWindowClass(); 131 ATOM RegisterNativeWindowClass();
125 132
126 // Our WndProc functions. 133 // Our WndProc functions.
127 static LRESULT CALLBACK NativeWndProc( 134 static LRESULT CALLBACK NativeWndProc(
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 WNDPROC plugin_wnd_proc_; 186 WNDPROC plugin_wnd_proc_;
180 187
181 // Used to throttle WM_USER+1 messages in Flash. 188 // Used to throttle WM_USER+1 messages in Flash.
182 uint32 last_message_; 189 uint32 last_message_;
183 bool is_calling_wndproc; 190 bool is_calling_wndproc;
184 191
185 HWND parent_; 192 HWND parent_;
186 NPWindow window_; 193 NPWindow window_;
187 gfx::Rect window_rect_; 194 gfx::Rect window_rect_;
188 gfx::Rect clip_rect_; 195 gfx::Rect clip_rect_;
196 std::vector<gfx::Rect> cutout_rects_;
189 int quirks_; 197 int quirks_;
190 198
191 // We only move/size the plugin window once after its creation. The 199 // We only move/size the plugin window once after its creation. The
192 // rest of the moves are controlled by the browser. This flag controls 200 // rest of the moves are controlled by the browser. This flag controls
193 // this behaviour. 201 // this behaviour.
194 bool initial_plugin_resize_done_; 202 bool initial_plugin_resize_done_;
195 203
196 // Windowless plugins don't have keyboard focus causing issues with the 204 // Windowless plugins don't have keyboard focus causing issues with the
197 // plugin not receiving keyboard events if the plugin enters a modal 205 // plugin not receiving keyboard events if the plugin enters a modal
198 // loop like TrackPopupMenuEx or MessageBox, etc. 206 // loop like TrackPopupMenuEx or MessageBox, etc.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 bool load_manually_; 261 bool load_manually_;
254 262
255 // Indicates whether a geometry update sequence is the first. 263 // Indicates whether a geometry update sequence is the first.
256 bool first_geometry_update_; 264 bool first_geometry_update_;
257 265
258 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateImpl); 266 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateImpl);
259 }; 267 };
260 268
261 #endif // #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H__ 269 #endif // #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H__
262 270
OLDNEW
« no previous file with comments | « webkit/data/layout_tests/pending/plugins/simple_blank.swf ('k') | webkit/glue/plugins/webplugin_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698