Bug 835591: Disable cross-process IME when it's not used. r=roc

This commit is contained in:
Chris Jones 2013-01-28 15:56:28 -08:00
Родитель e2eebcee03
Коммит bf3e0b59e2
1 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -57,7 +57,11 @@ MightNeedIMEFocus(const nsWidgetInitData* aInitData)
{
// In the puppet-widget world, popup widgets are just dummies and
// shouldn't try to mess with IME state.
#ifdef MOZ_CROSS_PROCESS_IME
return !IsPopup(aInitData);
#else
return false;
#endif
}
@ -333,6 +337,10 @@ PuppetWidget::GetThebesSurface()
nsresult
PuppetWidget::IMEEndComposition(bool aCancel)
{
#ifndef MOZ_CROSS_PROCESS_IME
return NS_OK;
#endif
nsEventStatus status;
nsTextEvent textEvent(true, NS_TEXT_TEXT, this);
InitEvent(textEvent, nullptr);
@ -372,6 +380,10 @@ NS_IMETHODIMP_(void)
PuppetWidget::SetInputContext(const InputContext& aContext,
const InputContextAction& aAction)
{
#ifndef MOZ_CROSS_PROCESS_IME
return;
#endif
if (!mTabChild) {
return;
}
@ -388,6 +400,10 @@ PuppetWidget::SetInputContext(const InputContext& aContext,
NS_IMETHODIMP_(InputContext)
PuppetWidget::GetInputContext()
{
#ifndef MOZ_CROSS_PROCESS_IME
return InputContext();
#endif
InputContext context;
if (mTabChild) {
int32_t enabled, open;
@ -401,6 +417,10 @@ PuppetWidget::GetInputContext()
NS_IMETHODIMP
PuppetWidget::OnIMEFocusChange(bool aFocus)
{
#ifndef MOZ_CROSS_PROCESS_IME
return NS_OK;
#endif
if (!mTabChild)
return NS_ERROR_FAILURE;
@ -440,6 +460,10 @@ PuppetWidget::OnIMEFocusChange(bool aFocus)
NS_IMETHODIMP
PuppetWidget::OnIMETextChange(uint32_t aStart, uint32_t aEnd, uint32_t aNewEnd)
{
#ifndef MOZ_CROSS_PROCESS_IME
return NS_OK;
#endif
if (!mTabChild)
return NS_ERROR_FAILURE;
@ -463,6 +487,10 @@ PuppetWidget::OnIMETextChange(uint32_t aStart, uint32_t aEnd, uint32_t aNewEnd)
NS_IMETHODIMP
PuppetWidget::OnIMESelectionChange(void)
{
#ifndef MOZ_CROSS_PROCESS_IME
return NS_OK;
#endif
if (!mTabChild)
return NS_ERROR_FAILURE;