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

Unified Diff: ui/base/ime/remote_input_method_win.h

Issue 67503004: Introduce RemoteInputMethodWin (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
Index: ui/base/ime/remote_input_method_win.h
diff --git a/ui/base/ime/remote_input_method_win.h b/ui/base/ime/remote_input_method_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..54834064a7130b2841b85175204fdcdc854ea45d
--- /dev/null
+++ b/ui/base/ime/remote_input_method_win.h
@@ -0,0 +1,75 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_BASE_IME_REMOTE_INPUT_METHOD_WIN_H_
+#define UI_BASE_IME_REMOTE_INPUT_METHOD_WIN_H_
+
+#include <Windows.h>
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/base/ui_export.h"
+
+namespace ui {
+namespace internal {
+class InputMethodDelegate;
+class RemoteInputMethodDelegateWin;
+} // namespace internal
+
+class InputMethod;
+
+// RemoteInputMethodWin is a special implementation of ui::InputMethod that
+// works as a proxy of an IME handler running in the metro_driver process.
+// RemoteInputMethodWin works as follows.
+// - Any action to RemoteInputMethodPrivateWin should be delegated to the
+// metro_driver process via RemoteInputMethodDelegateWin.
+// - Data retrieval from RemoteInputMethodPrivateWin is implemented with
+// data cache. Whenever the IME state in the metro_driver process is changed,
+// someone needs to call RemoteInputMethodPrivateWin::OnCandidatePopupChanged
Seigo Nonaka 2013/11/18 20:00:27 Could you add example for this "someone"?
yukawa 2013/11/19 07:17:51 Done.
+// and RemoteInputMethodPrivateWin::OnLanguageChanged to update the data
+// cache.
+// Caveats: RemoteInputMethodWin does not support InputMethodObserver yet.
+
+// Returns the public interface of RemoteInputMethodWin.
+// Caveats: Currently only one instance of RemoteInputMethodWin is able to run
+// at the same time.
+UI_EXPORT scoped_ptr<InputMethod> CreateRemoteInputMethodWin(
Seigo Nonaka 2013/11/18 20:00:27 How about moving this function into static class f
yukawa 2013/11/19 07:17:51 Sorry, to which class? 1) class UI_EXPORT RemoteI
Seigo Nonaka 2013/11/20 04:14:29 Sorry I miss understood. Current comment is fine.
+ internal::InputMethodDelegate* delegate);
+
+// Private interface of RemoteInputMethodWin.
+class UI_EXPORT RemoteInputMethodPrivateWin {
+ public:
+ RemoteInputMethodPrivateWin();
+
+ // Returns the private interface of RemoteInputMethodWin when and only when
+ // |input_method| is instanciated via CreateRemoteInputMethodWin. Caller does
+ // not take the ownership of the returned object.
+ // As you might notice, this is yet another reinplementation of dynamic_cast
+ // or IUnknown::QueryInterface.
+ static RemoteInputMethodPrivateWin* Get(InputMethod* input_method);
+
+ // Installs additional delegate that is required by RemoteInputMethodWin.
Seigo Nonaka 2013/11/18 20:00:27 Sorry, I'm bit confused with this comment. An inst
yukawa 2013/11/19 07:17:51 No, multiple delegates are not supported. Updated
+ virtual void SetRemoteDelegate(
+ internal::RemoteInputMethodDelegateWin* delegate) = 0;
+
+ // Synchronizes that the visibility of IME's popup window in the remote
+ // process. RemoteInputMethodWin::IsCandidatePopupOpen relies on this
+ // notification.
+ virtual void OnCandidatePopupChanged(bool visible) = 0;
+
+ // Synchronizes that Win32 LANGID and the presence of IME in the remote
+ // process. RemoteInputMethodWin::GetInputLocale and
+ // RemoteInputMethodWin::GetInputLocale rely on this notification.
+ virtual void OnLanguageChanged(LANGID langid, bool is_ime) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RemoteInputMethodPrivateWin);
+};
+
+} // namespace ui
+
+#endif // UI_BASE_IME_REMOTE_INPUT_METHOD_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698