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

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

Issue 399090: Mac: Simulate the OS-level focus handling that windows and linux plugins... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include <string> 10 #include <string>
11 #include <list> 11 #include <list>
12 #include <set>
12 13
13 #include "app/gfx/native_widget_types.h" 14 #include "app/gfx/native_widget_types.h"
14 #include "base/file_path.h" 15 #include "base/file_path.h"
15 #include "base/gfx/rect.h" 16 #include "base/gfx/rect.h"
16 #include "base/ref_counted.h" 17 #include "base/ref_counted.h"
17 #include "base/task.h" 18 #include "base/task.h"
18 #include "third_party/npapi/bindings/npapi.h" 19 #include "third_party/npapi/bindings/npapi.h"
19 #include "webkit/glue/webcursor.h" 20 #include "webkit/glue/webcursor.h"
20 #include "webkit/glue/webplugin_delegate.h" 21 #include "webkit/glue/webplugin_delegate.h"
21 22
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // Returns the path for the library implementing this plugin. 107 // Returns the path for the library implementing this plugin.
107 FilePath GetPluginPath(); 108 FilePath GetPluginPath();
108 109
109 // Returns a combination of PluginQuirks. 110 // Returns a combination of PluginQuirks.
110 int GetQuirks() const { return quirks_; } 111 int GetQuirks() const { return quirks_; }
111 112
112 #if defined(OS_MACOSX) 113 #if defined(OS_MACOSX)
113 // Informs the delegate that the context used for painting windowless plugins 114 // Informs the delegate that the context used for painting windowless plugins
114 // has changed. 115 // has changed.
115 void UpdateContext(gfx::NativeDrawingContext context); 116 void UpdateContext(gfx::NativeDrawingContext context);
117 // returns a vector of currently active delegates in this process.
118 static std::set<WebPluginDelegateImpl*> GetActiveDelegates();
119 // Informs the delegate which plugin instance has just received keyboard focus
120 // so that it can notify the plugin as appropriate. If |process_id| and
121 // |instance_id| are both 0, this signifies that no plugin has keyboard
122 // focus.
123 void FocusNotify(WebPluginDelegateImpl* focused_delegate);
124 // Set a notifier function that gets called when the delegate is accepting
125 // the focus. If no notifier function has been set, the delegate will just
126 // call FocusNotify(this). This is used in a multiprocess environment to
127 // propagate focus notifications to all running plugin processes.
128 void SetFocusNotifier(void (*notifier)(WebPluginDelegateImpl*)) {
129 focus_notifier_ = notifier;
130 }
116 #endif 131 #endif
117 132
118 private: 133 private:
119 friend class DeleteTask<WebPluginDelegateImpl>; 134 friend class DeleteTask<WebPluginDelegateImpl>;
120 friend class webkit_glue::WebPluginDelegate; 135 friend class webkit_glue::WebPluginDelegate;
121 136
122 WebPluginDelegateImpl(gfx::PluginWindowHandle containing_view, 137 WebPluginDelegateImpl(gfx::PluginWindowHandle containing_view,
123 NPAPI::PluginInstance *instance); 138 NPAPI::PluginInstance *instance);
124 ~WebPluginDelegateImpl(); 139 ~WebPluginDelegateImpl();
125 140
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // Runnable Method Factory used to drip null events into the plugin. 313 // Runnable Method Factory used to drip null events into the plugin.
299 ScopedRunnableMethodFactory<WebPluginDelegateImpl> null_event_factory_; 314 ScopedRunnableMethodFactory<WebPluginDelegateImpl> null_event_factory_;
300 315
301 // we've shut down the plugin, but can't delete ourselves until the last 316 // we've shut down the plugin, but can't delete ourselves until the last
302 // idle event comes in. 317 // idle event comes in.
303 bool waiting_to_die_; 318 bool waiting_to_die_;
304 319
305 // Last mouse position within the plugin's rect (used for null events). 320 // Last mouse position within the plugin's rect (used for null events).
306 int last_mouse_x_; 321 int last_mouse_x_;
307 int last_mouse_y_; 322 int last_mouse_y_;
323 // True if the plugin thinks it has keyboard focus
324 bool have_focus_;
325 // A function to call when we want to accept keyboard focus
326 void (*focus_notifier_)(WebPluginDelegateImpl* notifier);
308 #endif 327 #endif
309 328
310 // Called by the message filter hook when the plugin enters a modal loop. 329 // Called by the message filter hook when the plugin enters a modal loop.
311 void OnModalLoopEntered(); 330 void OnModalLoopEntered();
312 331
313 // Returns true if the message passed in corresponds to a user gesture. 332 // Returns true if the message passed in corresponds to a user gesture.
314 static bool IsUserGestureMessage(unsigned int message); 333 static bool IsUserGestureMessage(unsigned int message);
315 334
316 // Indicates the end of a user gesture period. 335 // Indicates the end of a user gesture period.
317 void OnUserGestureEnd(); 336 void OnUserGestureEnd();
(...skipping 22 matching lines...) Expand all
340 ScopedRunnableMethodFactory<WebPluginDelegateImpl> user_gesture_msg_factory_; 359 ScopedRunnableMethodFactory<WebPluginDelegateImpl> user_gesture_msg_factory_;
341 #endif 360 #endif
342 361
343 // Holds the current cursor set by the windowless plugin. 362 // Holds the current cursor set by the windowless plugin.
344 WebCursor current_windowless_cursor_; 363 WebCursor current_windowless_cursor_;
345 364
346 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); 365 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl);
347 }; 366 };
348 367
349 #endif // WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ 368 #endif // WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/plugin/webplugin_delegate_stub.cc ('k') | webkit/glue/plugins/webplugin_delegate_impl_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698