Skip to content

Commit

Permalink
Added initial window build
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeshkova committed Nov 29, 2014
1 parent 2ddfb7d commit 985593a
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 97 deletions.
Expand Up @@ -87,7 +87,7 @@ EmbedLiteAppProcessChild::Init(MessageLoop* aIOLoop,
void
EmbedLiteAppProcessChild::InitXPCOM()
{
LOGT();
LOGT("Initialize some global XPCOM stuff here");
unused << SendInitialized();
}

Expand Down
13 changes: 13 additions & 0 deletions embedding/embedlite/embedprocess/EmbedLiteViewProcessChild.cpp
@@ -1,6 +1,8 @@
#include "EmbedLiteViewProcessChild.h"

#include "EmbedLog.h"
#include "nsEmbedCID.h"
#include "nsIBaseWindow.h"

namespace mozilla {
namespace embedlite {
Expand Down Expand Up @@ -30,6 +32,17 @@ EmbedLiteViewProcessChild::InitGeckoWindow(const uint32_t& parentId)
mInitWindowTask = nullptr;

// TODO initialize Gecko browser
nsresult rv;
mWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &rv);
if (NS_FAILED(rv)) {
return;
}

gfxPrefs::GetSingleton();
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(mWebBrowser, &rv);
if (NS_FAILED(rv)) {
return;
}

unused << SendInitialized();
}
Expand Down
212 changes: 116 additions & 96 deletions embedding/embedlite/embedprocess/EmbedLiteViewProcessChild.h
Expand Up @@ -8,141 +8,161 @@

#include "mozilla/embedlite/PEmbedLiteViewChild.h"

#include "nsIWebBrowser.h"
#include "nsIWidget.h"
#include "nsIWebNavigation.h"
#include "WebBrowserChrome.h"
#include "nsIEmbedBrowserChromeListener.h"
#include "TabChildHelper.h"

namespace mozilla {
namespace embedlite {

class EmbedLiteViewProcessChild : public PEmbedLiteViewChild
{
NS_INLINE_DECL_REFCOUNTING(EmbedLiteViewProcessChild)
NS_INLINE_DECL_REFCOUNTING(EmbedLiteViewProcessChild)
public:
MOZ_IMPLICIT EmbedLiteViewProcessChild(const uint32_t& id, const uint32_t& parentId);
virtual ~EmbedLiteViewProcessChild();
MOZ_IMPLICIT EmbedLiteViewProcessChild(const uint32_t& id, const uint32_t& parentId);
virtual ~EmbedLiteViewProcessChild();

private:
void InitGeckoWindow(const uint32_t& parentId);
void InitGeckoWindow(const uint32_t& parentId);

protected:
virtual bool
RecvLoadURL(const nsString& url);
virtual bool
RecvLoadURL(const nsString& url);

virtual bool
RecvGoBack();

virtual bool
RecvGoForward();

virtual bool
RecvStopLoad();

virtual bool
RecvGoBack();
virtual bool
RecvReload(const bool& hardReload);

virtual bool
RecvGoForward();
virtual bool
RecvLoadFrameScript(const nsString& uri);

virtual bool
RecvStopLoad();
virtual bool
RecvSetViewSize(const gfxSize& aSize);

virtual bool
RecvReload(const bool& hardReload);
virtual bool
RecvSetGLViewSize(const gfxSize& aSize);

virtual bool
RecvLoadFrameScript(const nsString& uri);
virtual bool
RecvSetIsActive(const bool& aIsActive);

virtual bool
RecvSetViewSize(const gfxSize& aSize);
virtual bool
RecvSetIsFocused(const bool& aIsFocused);

virtual bool
RecvSetGLViewSize(const gfxSize& aSize);
virtual bool
RecvSuspendTimeouts();

virtual bool
RecvSetIsActive(const bool& aIsActive);
virtual bool
RecvResumeTimeouts();

virtual bool
RecvSetIsFocused(const bool& aIsFocused);
virtual bool
RecvAsyncScrollDOMEvent(
const gfxRect& contentRect,
const gfxSize& scrollSize);

virtual bool
RecvSuspendTimeouts();
virtual bool
RecvUpdateFrame(const FrameMetrics& frame);

virtual bool
RecvResumeTimeouts();
virtual bool
RecvHandleDoubleTap(const nsIntPoint& point);

virtual bool
RecvAsyncScrollDOMEvent(
const gfxRect& contentRect,
const gfxSize& scrollSize);
virtual bool
RecvHandleSingleTap(const nsIntPoint& point);

virtual bool
RecvUpdateFrame(const FrameMetrics& frame);
virtual bool
RecvHandleLongTap(
const nsIntPoint& point,
const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId);

virtual bool
RecvHandleDoubleTap(const nsIntPoint& point);
virtual bool
RecvAcknowledgeScrollUpdate(
const ViewID& aScrollId,
const uint32_t& aScrollGeneration);

virtual bool
RecvHandleSingleTap(const nsIntPoint& point);
virtual bool
RecvHandleTextEvent(
const nsString& commit,
const nsString& preEdit);

virtual bool
RecvHandleLongTap(
const nsIntPoint& point,
const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId);
virtual bool
RecvHandleKeyPressEvent(
const int& domKeyCode,
const int& gmodifiers,
const int& charCode);

virtual bool
RecvAcknowledgeScrollUpdate(
const ViewID& aScrollId,
const uint32_t& aScrollGeneration);
virtual bool
RecvHandleKeyReleaseEvent(
const int& domKeyCode,
const int& gmodifiers,
const int& charCode);

virtual bool
RecvHandleTextEvent(
const nsString& commit,
const nsString& preEdit);
virtual bool
RecvMouseEvent(
const nsString& aType,
const float& aX,
const float& aY,
const int32_t& aButton,
const int32_t& aClickCount,
const int32_t& aModifiers,
const bool& aIgnoreRootScrollFrame);

virtual bool
RecvHandleKeyPressEvent(
const int& domKeyCode,
const int& gmodifiers,
const int& charCode);
virtual bool
RecvInputDataTouchEvent(
const ScrollableLayerGuid& aGuid,
const MultiTouchInput& event,
const uint64_t& aInputBlockId);

virtual bool
RecvHandleKeyReleaseEvent(
const int& domKeyCode,
const int& gmodifiers,
const int& charCode);
virtual bool
RecvInputDataTouchMoveEvent(
const ScrollableLayerGuid& aGuid,
const MultiTouchInput& event,
const uint64_t& aInputBlockId);

virtual bool
RecvMouseEvent(
const nsString& aType,
const float& aX,
const float& aY,
const int32_t& aButton,
const int32_t& aClickCount,
const int32_t& aModifiers,
const bool& aIgnoreRootScrollFrame);
virtual bool
RecvAddMessageListener(const nsCString& name);

virtual bool
RecvInputDataTouchEvent(
const ScrollableLayerGuid& aGuid,
const MultiTouchInput& event,
const uint64_t& aInputBlockId);
virtual bool
RecvRemoveMessageListener(const nsCString& name);

virtual bool
RecvInputDataTouchMoveEvent(
const ScrollableLayerGuid& aGuid,
const MultiTouchInput& event,
const uint64_t& aInputBlockId);
virtual bool
RecvAddMessageListeners(const nsTArray<nsString>& messageNames);

virtual bool
RecvAddMessageListener(const nsCString& name);
virtual bool
RecvRemoveMessageListeners(const nsTArray<nsString>& messageNames);

virtual bool
RecvRemoveMessageListener(const nsCString& name);
virtual bool
RecvDestroy();

virtual bool
RecvAddMessageListeners(const nsTArray<nsString>& messageNames);
virtual bool
RecvAsyncMessage(const nsString& aMessage,
const nsString& aData);

virtual bool
RecvRemoveMessageListeners(const nsTArray<nsString>& messageNames);

virtual bool
RecvDestroy();

virtual bool
RecvAsyncMessage(
const nsString& aMessage,
const nsString& aData);
private:
CancelableTask* mInitWindowTask;
nsCOMPtr<nsIWebBrowser> mWebBrowser;

uint32_t mId;
uint64_t mOuterId;
nsCOMPtr<nsIWidget> mWidget;
nsRefPtr<WebBrowserChrome> mChrome;
nsCOMPtr<nsIDOMWindow> mDOMWindow;
nsCOMPtr<nsIWebNavigation> mWebNavigation;
gfxSize mViewSize;
bool mViewResized;
gfxSize mGLViewSize;

DISALLOW_EVIL_CONSTRUCTORS(EmbedLiteViewProcessChild);
};
} // namespace embedlite
} // namespace mozilla
Expand Down
2 changes: 2 additions & 0 deletions embedding/embedlite/embedprocess/EmbedLiteViewProcessParent.h
Expand Up @@ -136,6 +136,8 @@ class EmbedLiteViewProcessParent : public PEmbedLiteViewParent,

private:
EmbedLiteView* mView;

DISALLOW_EVIL_CONSTRUCTORS(EmbedLiteViewProcessParent);
};
} // namespace embedlite
} // namespace mozilla
Expand Down

0 comments on commit 985593a

Please sign in to comment.