| Index: ui/base/ime/input_method_factory.cc
|
| diff --git a/ui/base/ime/input_method_factory.cc b/ui/base/ime/input_method_factory.cc
|
| index 6b0bd72b4d3a861228e7a69198c8f7ecd21a4333..3bf240683bfaf43ded8ef7e953cf498b96133106 100644
|
| --- a/ui/base/ime/input_method_factory.cc
|
| +++ b/ui/base/ime/input_method_factory.cc
|
| @@ -13,6 +13,7 @@
|
| #include "base/win/metro.h"
|
| #include "ui/base/ime/input_method_imm32.h"
|
| #include "ui/base/ime/input_method_tsf.h"
|
| +#include "ui/base/ime/remote_input_method_win.h"
|
| #elif defined(USE_AURA) && defined(USE_X11)
|
| #include "ui/base/ime/input_method_linux_x11.h"
|
| #else
|
| @@ -26,11 +27,27 @@ bool g_input_method_set_for_testing = false;
|
| InputMethod* g_shared_input_method = NULL;
|
|
|
| #if defined(OS_WIN)
|
| +bool IsWindowImmersive(HWND window_handle) {
|
| + DWORD process_id = 0;
|
| + if (::GetWindowThreadProcessId(window_handle, &process_id) == 0)
|
| + return false;
|
| + // TODO(yukawa): Use ScopedHandle.
|
| + HANDLE process_handle = ::OpenProcess(
|
| + PROCESS_QUERY_LIMITED_INFORMATION, FALSE, process_id);
|
| + if (process_handle == NULL)
|
| + return false;
|
| + const bool result = base::win::IsProcessImmersive(process_handle);
|
| + ::CloseHandle(process_handle);
|
| + return result;
|
| +}
|
| +
|
| // Returns a new instance of input method object for IMM32 or TSF.
|
| scoped_ptr<InputMethod> CreateInputMethodWinInternal(
|
| internal::InputMethodDelegate* delegate,
|
| gfx::AcceleratedWidget widget) {
|
| - if (base::win::IsTSFAwareRequired())
|
| + if (IsWindowImmersive(widget))
|
| + return CreateRemoteInputMethodWin(delegate);
|
| + else if(base::win::IsTSFAwareRequired())
|
| return scoped_ptr<InputMethod>(new InputMethodTSF(delegate, widget));
|
| else
|
| return scoped_ptr<InputMethod>(new InputMethodIMM32(delegate, widget));
|
|
|