Bug 685395 part.4 IME open state should be able to set/get by InputContext r=roc, sr=matspal

This commit is contained in:
Masayuki Nakano
2011-11-27 20:51:53 +09:00
parent c7b04c3d79
commit d3338a0721
22 changed files with 264 additions and 293 deletions

View File

@@ -1041,11 +1041,15 @@ nsDOMWindowUtils::GetIMEIsOpen(bool *aState)
// Open state should not be available when IME is not enabled.
InputContext context = widget->GetInputContext();
if (context.mIMEEnabled != InputContext::IME_ENABLED) {
if (context.mIMEState.mEnabled != IMEState::ENABLED) {
return NS_ERROR_NOT_AVAILABLE;
}
return widget->GetIMEOpenState(aState);
if (context.mIMEState.mOpen == IMEState::OPEN_STATE_NOT_SUPPORTED) {
return NS_ERROR_NOT_IMPLEMENTED;
}
*aState = (context.mIMEState.mOpen == IMEState::OPEN);
return NS_OK;
}
NS_IMETHODIMP
@@ -1058,7 +1062,7 @@ nsDOMWindowUtils::GetIMEStatus(PRUint32 *aState)
return NS_ERROR_FAILURE;
InputContext context = widget->GetInputContext();
*aState = context.mIMEEnabled;
*aState = static_cast<PRUint32>(context.mIMEState.mEnabled);
return NS_OK;
}