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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PLUGIN_PLUGIN_INTERPOSE_UTIL_MAC_H_
6 #define CONTENT_PLUGIN_PLUGIN_INTERPOSE_UTIL_MAC_H_
8 #include <Carbon/Carbon.h>
10 #import "base/basictypes.h"
12 // This is really a WebPluginDelegateImpl, but that class is private to the
13 // framework, and these functions are called from a dylib.
14 typedef void* OpaquePluginRef
;
16 namespace mac_plugin_interposing
{
18 // Swizzles methods we need to watch in order to manage process and window
20 void SetUpCocoaInterposing();
22 // Brings the plugin process to the front so that the user can see its windows.
23 void SwitchToPluginProcess();
25 // Returns the delegate currently processing events.
26 OpaquePluginRef
GetActiveDelegate();
28 // Sends a message to the browser process to inform it that the given window
29 // has been brought forward.
30 void NotifyBrowserOfPluginSelectWindow(uint32 window_id
, CGRect bounds
,
33 // Sends a message to the browser process to inform it that the given window
35 void NotifyBrowserOfPluginShowWindow(uint32 window_id
, CGRect bounds
,
38 // Sends a message to the browser process to inform it that the given window
39 // has been hidden, and switches focus back to the browser process if there are
40 // no remaining plugin windows.
41 void NotifyBrowserOfPluginHideWindow(uint32 window_id
, CGRect bounds
);
43 } // namespace MacPluginInterpose
45 #endif // CONTENT_PLUGIN_PLUGIN_INTERPOSE_UTIL_MAC_H_