-
Notifications
You must be signed in to change notification settings - Fork 16
/
EmbedLiteViewBaseParent.h
149 lines (117 loc) · 4.95 KB
/
EmbedLiteViewBaseParent.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* 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 MOZ_VIEW_EMBED_BASE_PARENT_H
#define MOZ_VIEW_EMBED_BASE_PARENT_H
#include "mozilla/embedlite/PEmbedLiteViewParent.h"
#include "mozilla/WidgetUtils.h"
#include "EmbedLiteViewIface.h"
#include "EmbedLiteWindowBaseParent.h"
#include "GLDefs.h"
namespace mozilla {
namespace embedlite {
class EmbedContentController;
class EmbedLiteCompositorParent;
class EmbedLiteView;
class EmbedLiteViewBaseParent : public PEmbedLiteViewParent,
public EmbedLiteViewIface,
public EmbedLiteWindowParentObserver
{
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(EmbedLiteViewBaseParent)
public:
EmbedLiteViewBaseParent(const uint32_t& windowId, const uint32_t& id, const uint32_t& parentId, const bool& isPrivateWindow);
NS_DECL_EMBEDLITEVIEWIFACE
EmbedLiteCompositorParent* GetCompositor() { return mCompositor.get(); }; // XXX: Remove
protected:
virtual ~EmbedLiteViewBaseParent();
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
virtual bool
RecvInitialized() override;
virtual bool
RecvDestroyed() override;
virtual bool
RecvOnLocationChanged(const nsCString& aLocation, const bool& aCanGoBack, const bool& aCanGoForward) override;
virtual bool
RecvOnLoadStarted(const nsCString& aLocation) override;
virtual bool
RecvOnLoadFinished() override;
virtual bool
RecvOnWindowCloseRequested() override;
virtual bool
RecvOnLoadRedirect() override;
virtual bool
RecvOnLoadProgress(const int32_t& aProgress, const int32_t& aCurTotal, const int32_t& aMaxTotal) override;
virtual bool
RecvOnSecurityChanged(
const nsCString& aStatus,
const uint32_t& aState) override;
virtual bool
RecvOnFirstPaint(
const int32_t& aX,
const int32_t& aY) override;
virtual bool
RecvOnScrolledAreaChanged(
const uint32_t& aWidth,
const uint32_t& aHeight) override;
virtual bool
RecvOnScrollChanged(
const int32_t& offSetX,
const int32_t& offSetY) override;
virtual bool
RecvOnTitleChanged(const nsString& aTitle) override;
virtual bool RecvAsyncMessage(const nsString& aMessage,
const nsString& aData) override;
virtual bool RecvSyncMessage(const nsString& aMessage,
const nsString& aJSON,
InfallibleTArray<nsString>* aJSONRetVal) override;
virtual bool RecvRpcMessage(const nsString& aMessage,
const nsString& aJSON,
InfallibleTArray<nsString>* aJSONRetVal) override;
virtual bool
RecvUpdateZoomConstraints(const uint32_t& aPresShellId,
const ViewID& aViewId,
const bool& aIsRoot,
const ZoomConstraints& aConstraints) override;
virtual bool RecvZoomToRect(const uint32_t& aPresShellId,
const ViewID& aViewId,
const CSSRect& aRect) override;
virtual bool RecvSetBackgroundColor(const nscolor& aColor) override;
virtual bool RecvContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId,
const bool& aPreventDefault) override;
// IME
virtual bool RecvGetInputContext(int32_t* aIMEEnabled,
int32_t* aIMEOpen,
intptr_t* aNativeIMEContext) override;
virtual bool RecvSetInputContext(const int32_t& aIMEEnabled,
const int32_t& aIMEOpen,
const nsString& aType,
const nsString& aInputmode,
const nsString& aActionHint,
const int32_t& aCause,
const int32_t& aFocusChange) override;
// EmbedLiteWindowParentObserver:
void CompositorCreated() override;
private:
friend class EmbedContentController;
friend class EmbedLiteCompositorParent;
// The sole purpose of this friendliness is to set mView which is used only as a proxy to view's Listener
friend class EmbedLiteView;
void SetCompositor(EmbedLiteCompositorParent* aCompositor); // XXX: Remove
void UpdateScrollController();
uint32_t mId;
EmbedLiteView* mView;
bool mViewAPIDestroyed;
EmbedLiteWindowBaseParent& mWindow;
RefPtr<EmbedLiteCompositorParent> mCompositor;
MessageLoop* mUILoop;
int mLastIMEState;
uint64_t mRootLayerTreeId;
GLuint mUploadTexture;
nsRefPtr<EmbedContentController> mController;
DISALLOW_EVIL_CONSTRUCTORS(EmbedLiteViewBaseParent);
};
} // namespace embedlite
} // namespace mozilla
#endif // MOZ_VIEW_EMBED_BASE_PARENT_H