Skip to content

Commit

Permalink
Bug 1177943 - Part 5. Add IPC for e10s support. r=masayuki
Browse files Browse the repository at this point in the history
Implement LookUpDictionary to PuppetWidget and PBrowser for e10s.

MozReview-Commit-ID: 44SrfuLJoCF
  • Loading branch information
makotokato committed Apr 26, 2016
1 parent 068d604 commit 66b47b8
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dom/ipc/PBrowser.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ using nsEventStatus from "mozilla/EventForwards.h";
using nsSizeMode from "nsIWidgetListener.h";
using mozilla::widget::CandidateWindowPosition from "ipc/nsGUIEventIPC.h";
using class mozilla::NativeEventData from "ipc/nsGUIEventIPC.h";
using mozilla::FontRange from "ipc/nsGUIEventIPC.h";

namespace mozilla {
namespace dom {
Expand Down Expand Up @@ -461,6 +462,16 @@ parent:
*/
async AsyncAuthPrompt(nsCString uri, nsString realm, uint64_t aCallbackId);

/**
* Look up dictionary by selected word for OSX
*
* @param aText The word to look up
* @param aFontRange Text decoration of aText
* @param aIsVertical true if vertical layout
*/
async LookUpDictionary(nsString aText, FontRange[] aFontRangeArray,
bool aIsVertical, LayoutDeviceIntPoint aPoint);

async __delete__();

async ReplyKeyEvent(WidgetKeyboardEvent event);
Expand Down
16 changes: 16 additions & 0 deletions dom/ipc/TabParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3415,6 +3415,22 @@ TabParent::RecvGetTabCount(uint32_t* aValue)
return true;
}

bool
TabParent::RecvLookUpDictionary(const nsString& aText,
nsTArray<FontRange>&& aFontRangeArray,
const bool& aIsVertical,
const LayoutDeviceIntPoint& aPoint)
{
nsCOMPtr<nsIWidget> widget = GetWidget();
if (!widget) {
return true;
}

widget->LookUpDictionary(aText, aFontRangeArray, aIsVertical,
aPoint - GetChildProcessOffset());
return true;
}

NS_IMETHODIMP
FakeChannel::OnAuthAvailable(nsISupports *aContext, nsIAuthInformation *aAuthInfo)
{
Expand Down
6 changes: 6 additions & 0 deletions dom/ipc/TabParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ class TabParent final : public PBrowserParent

virtual bool RecvRequestFocus(const bool& aCanRaise) override;

virtual bool RecvLookUpDictionary(
const nsString& aText,
nsTArray<mozilla::FontRange>&& aFontRangeArray,
const bool& aIsVertical,
const LayoutDeviceIntPoint& aPoint) override;

virtual bool
RecvEnableDisableCommands(const nsString& aAction,
nsTArray<nsCString>&& aEnabledCommands,
Expand Down
14 changes: 14 additions & 0 deletions widget/PuppetWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,20 @@ PuppetWidget::ZoomToRect(const uint32_t& aPresShellId,
mTabChild->ZoomToRect(aPresShellId, aViewId, aRect, aFlags);
}

void
PuppetWidget::LookUpDictionary(
const nsAString& aText,
const nsTArray<mozilla::FontRange>& aFontRangeArray,
const bool aIsVertical,
const LayoutDeviceIntPoint& aPoint)
{
if (!mTabChild) {
return;
}

mTabChild->SendLookUpDictionary(nsString(aText), aFontRangeArray, aIsVertical, aPoint);
}

bool
PuppetWidget::HasPendingInputEvent()
{
Expand Down
6 changes: 6 additions & 0 deletions widget/PuppetWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ class PuppetWidget : public nsBaseWidget
const NativeEventData& aKeyEventData,
nsIKeyEventInPluginCallback* aCallback) override;

virtual void LookUpDictionary(
const nsAString& aText,
const nsTArray<mozilla::FontRange>& aFontRangeArray,
const bool aIsVertical,
const LayoutDeviceIntPoint& aPoint) override;

protected:
virtual nsresult NotifyIMEInternal(
const IMENotification& aIMENotification) override;
Expand Down

0 comments on commit 66b47b8

Please sign in to comment.