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"
|
2016-06-07 23:10:18 +03:00
|
|
|
#include "nsAutoPtr.h"
|
2014-11-12 23:59:19 +03:00
|
|
|
#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;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
2014-11-12 23:59:19 +03:00
|
|
|
|
|
|
|
namespace plugins {
|
|
|
|
|
|
|
|
class PluginWidgetParent : public PPluginWidgetParent
|
|
|
|
{
|
2015-01-29 22:41:56 +03:00
|
|
|
public:
|
2014-11-12 23:59:19 +03:00
|
|
|
PluginWidgetParent();
|
|
|
|
virtual ~PluginWidgetParent();
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
2016-10-05 18:36:26 +03:00
|
|
|
virtual bool RecvCreate(nsresult* aResult, uint64_t* aScrollCaptureId,
|
|
|
|
uintptr_t* aPluginInstanceId) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvSetFocus(const bool& aRaise) override;
|
|
|
|
virtual bool RecvGetNativePluginPort(uintptr_t* value) override;
|
2015-06-15 18:08:51 +03:00
|
|
|
bool RecvSetNativeChildWindow(const uintptr_t& aChildWindow) override;
|
2014-11-12 23:59:19 +03:00
|
|
|
|
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
|
|
|
|
|
|
|
private:
|
2015-03-10 14:33:20 +03:00
|
|
|
void KillWidget();
|
2015-02-19 16:05:12 +03:00
|
|
|
|
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
|
|
|
|
|