Bug 582644 - IME event remoting, patch for android; r=blassey, blocking-fennec=2.0a1+

This commit is contained in:
Jim Chen
2010-08-17 01:07:45 -07:00
parent 02e36306e3
commit 4eb09575c7
4 changed files with 62 additions and 23 deletions

View File

@@ -37,7 +37,10 @@
#include <android/log.h>
#ifdef MOZ_IPC
#include "mozilla/dom/ContentChild.h"
#include "nsXULAppAPI.h"
#endif
#include <pthread.h>
#include <prthread.h>
#include "nsXPCOMStrings.h"
@@ -192,8 +195,12 @@ AndroidBridge::NotifyIME(int aType, int aState)
if (sBridge)
JNI()->CallStaticVoidMethod(sBridge->mGeckoAppShellClass,
sBridge->jNotifyIME, aType, aState);
else
#ifdef MOZ_IPC
// It's possible that we are in chrome process
// but sBridge is not initialized yet
else if (XRE_GetProcessType() == GeckoProcessType_Content)
mozilla::dom::ContentChild::GetSingleton()->SendNotifyIME(aType, aState);
#endif
}
void
@@ -201,9 +208,11 @@ AndroidBridge::NotifyIMEChange(const PRUnichar *aText, PRUint32 aTextLen,
int aStart, int aEnd, int aNewEnd)
{
if (!sBridge) {
#ifdef MOZ_IPC
mozilla::dom::ContentChild::GetSingleton()->
SendNotifyIMEChange(nsAutoString(aText), aTextLen,
aStart, aEnd, aNewEnd);
#endif
return;
}