OLD | NEW |
| (Empty) |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_PLUGIN_PLUGIN_INTERPOSE_UTIL_MAC_H_ | |
6 #define CHROME_PLUGIN_PLUGIN_INTERPOSE_UTIL_MAC_H_ | |
7 #pragma once | |
8 | |
9 #include <Carbon/Carbon.h> | |
10 | |
11 #import "base/basictypes.h" | |
12 | |
13 // This is really a WebPluginDelegateImpl, but that class is private to the | |
14 // framework, and these functions are called from a dylib. | |
15 typedef void* OpaquePluginRef; | |
16 | |
17 namespace mac_plugin_interposing { | |
18 | |
19 // Swizzles methods we need to watch in order to manage process and window | |
20 // focus correctly. | |
21 void SetUpCocoaInterposing(); | |
22 | |
23 // Brings the plugin process to the front so that the user can see its windows. | |
24 void SwitchToPluginProcess(); | |
25 | |
26 // Returns the delegate currently processing events. | |
27 OpaquePluginRef GetActiveDelegate(); | |
28 | |
29 // Sends a message to the browser process to inform it that the given window | |
30 // has been brought forward. | |
31 void NotifyBrowserOfPluginSelectWindow(uint32 window_id, CGRect bounds, | |
32 bool modal); | |
33 | |
34 // Sends a message to the browser process to inform it that the given window | |
35 // has been shown. | |
36 void NotifyBrowserOfPluginShowWindow(uint32 window_id, CGRect bounds, | |
37 bool modal); | |
38 | |
39 // Sends a message to the browser process to inform it that the given window | |
40 // has been hidden, and switches focus back to the browser process if there are | |
41 // no remaining plugin windows. | |
42 void NotifyBrowserOfPluginHideWindow(uint32 window_id, CGRect bounds); | |
43 | |
44 // Sends a message to the plugin that a theme cursor was set. | |
45 void NotifyPluginOfSetThemeCursor(OpaquePluginRef delegate, | |
46 ThemeCursor cursor); | |
47 | |
48 // Sends a message to the plugin that a cursor was set. | |
49 void NotifyPluginOfSetCursor(OpaquePluginRef delegate, | |
50 const Cursor* cursor); | |
51 | |
52 // Returns true if the window containing the given plugin delegate is focused. | |
53 bool GetPluginWindowHasFocus(const OpaquePluginRef delegate); | |
54 | |
55 } // namespace MacPluginInterpose | |
56 | |
57 #endif // CHROME_PLUGIN_PLUGIN_INTERPOSE_UTIL_MAC_H_ | |
OLD | NEW |