Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: ui/base/ime/input_method_factory.cc

Issue 53553003: WIP: Ash IME support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/remote_root_window_host_win.cc ('k') | ui/metro_viewer/ime_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « ui/aura/remote_root_window_host_win.cc ('k') | ui/metro_viewer/ime_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698