2014-11-12 23:59:19 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_plugins_PluginWidgetParent_h
|
|
|
|
#define mozilla_plugins_PluginWidgetParent_h
|
|
|
|
|
|
|
|
#include "mozilla/plugins/PPluginWidgetParent.h"
|
|
|
|
#include "nsIWidget.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
2014-11-12 23:59:21 +03:00
|
|
|
#if defined(MOZ_WIDGET_GTK)
|
|
|
|
class nsPluginNativeWindowGtk;
|
|
|
|
#endif
|
|
|
|
|
2014-11-12 23:59:19 +03:00
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
class TabParent;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace plugins {
|
|
|
|
|
|
|
|
class PluginWidgetParent : public PPluginWidgetParent
|
|
|
|
{
|
2015-01-29 22:41:56 +03:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Windows helper for firing off an update window request to a plugin.
|
|
|
|
*
|
|
|
|
* aWidget - the eWindowType_plugin_ipc_chrome widget associated with
|
|
|
|
* this plugin window.
|
|
|
|
*/
|
|
|
|
static void SendAsyncUpdate(nsIWidget* aWidget);
|
|
|
|
|
2014-11-12 23:59:19 +03:00
|
|
|
PluginWidgetParent();
|
|
|
|
virtual ~PluginWidgetParent();
|
|
|
|
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
|
2015-02-06 00:48:44 +03:00
|
|
|
virtual bool RecvCreate(nsresult* aResult) MOZ_OVERRIDE;
|
2014-11-12 23:59:19 +03:00
|
|
|
virtual bool RecvDestroy() MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvSetFocus(const bool& aRaise) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvGetNativePluginPort(uintptr_t* value) MOZ_OVERRIDE;
|
|
|
|
|
2015-01-29 22:41:56 +03:00
|
|
|
// Helper for compositor checks on the channel
|
2015-02-19 16:05:12 +03:00
|
|
|
bool ActorDestroyed() { return !mWidget; }
|
2015-01-29 22:41:56 +03:00
|
|
|
|
|
|
|
// Called by PBrowser when it receives a Destroy() call from the child.
|
|
|
|
void ParentDestroy();
|
|
|
|
|
2015-02-09 02:50:01 +03:00
|
|
|
// Sets mWidget's parent
|
|
|
|
void SetParent(nsIWidget* aParent);
|
|
|
|
|
2014-11-12 23:59:19 +03:00
|
|
|
private:
|
|
|
|
// The tab our connection is associated with.
|
|
|
|
mozilla::dom::TabParent* GetTabParent();
|
2015-02-19 16:05:12 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
// Identifies the side of the connection that initiates shutdown.
|
|
|
|
enum ShutdownType {
|
|
|
|
TAB_CLOSURE = 1,
|
|
|
|
CONTENT = 2
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
void Shutdown(ShutdownType aType);
|
|
|
|
|
2014-11-12 23:59:19 +03:00
|
|
|
// The chrome side native widget.
|
|
|
|
nsCOMPtr<nsIWidget> mWidget;
|
2014-11-12 23:59:21 +03:00
|
|
|
#if defined(MOZ_WIDGET_GTK)
|
2015-01-29 22:41:57 +03:00
|
|
|
nsAutoPtr<nsPluginNativeWindowGtk> mWrapper;
|
2014-11-12 23:59:21 +03:00
|
|
|
#endif
|
2014-11-12 23:59:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace plugins
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_plugins_PluginWidgetParent_h
|
|
|
|
|