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

Side by Side 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: Revise comments, rename OnLanguageChanged to OnInputSourceChanged 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 unified diff | Download patch
« no previous file with comments | « ui/base/ime/remote_input_method_delegate_win.h ('k') | ui/base/ime/remote_input_method_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_BASE_IME_REMOTE_INPUT_METHOD_WIN_H_
6 #define UI_BASE_IME_REMOTE_INPUT_METHOD_WIN_H_
7
8 #include <Windows.h>
9
10 #include <string>
11
12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "ui/base/ui_export.h"
16
17 namespace ui {
18 namespace internal {
19 class InputMethodDelegate;
20 class RemoteInputMethodDelegateWin;
21 } // namespace internal
22
23 class InputMethod;
24
25 // RemoteInputMethodWin is a special implementation of ui::InputMethod that
26 // works as a proxy of an IME handler running in the metro_driver process.
27 // RemoteInputMethodWin works as follows.
28 // - Any action to RemoteInputMethodPrivateWin should be delegated to the
29 // metro_driver process via RemoteInputMethodDelegateWin.
30 // - Data retrieval from RemoteInputMethodPrivateWin is implemented with
31 // data cache. Whenever the IME state in the metro_driver process is changed,
32 // RemoteRootWindowHostWin, which receives IPCs from metro_driver process,
33 // will call RemoteInputMethodPrivateWin::OnCandidatePopupChanged and/or
34 // RemoteInputMethodPrivateWin::OnInputSourceChanged accordingly so that
35 // the state cache should be updated.
36 // Caveats: RemoteInputMethodWin does not support InputMethodObserver yet.
37
38 // Returns the public interface of RemoteInputMethodWin.
39 // Caveats: Currently only one instance of RemoteInputMethodWin is able to run
40 // at the same time.
41 UI_EXPORT scoped_ptr<InputMethod> CreateRemoteInputMethodWin(
42 internal::InputMethodDelegate* delegate);
43
44 // Private interface of RemoteInputMethodWin.
45 class UI_EXPORT RemoteInputMethodPrivateWin {
46 public:
47 RemoteInputMethodPrivateWin();
48
49 // Returns the private interface of RemoteInputMethodWin when and only when
50 // |input_method| is instanciated via CreateRemoteInputMethodWin. Caller does
51 // not take the ownership of the returned object.
52 // As you might notice, this is yet another reinplementation of dynamic_cast
53 // or IUnknown::QueryInterface.
54 static RemoteInputMethodPrivateWin* Get(InputMethod* input_method);
55
56 // Installs RemoteInputMethodDelegateWin delegate. Set NULL to |delegate| to
57 // unregister.
58 virtual void SetRemoteDelegate(
59 internal::RemoteInputMethodDelegateWin* delegate) = 0;
60
61 // Updates internal cache so that subsequent calls of
62 // RemoteInputMethodWin::IsCandidatePopupOpen can return the correct value
63 // based on remote IME activities in the metro_driver process.
64 virtual void OnCandidatePopupChanged(bool visible) = 0;
65
66 // Updates internal cache so that subsequent calls of
67 // RemoteInputMethodWin::GetInputLocale and
68 // RemoteInputMethodWin::GetInputTextDirection can return the correct
69 // values based on remote IME activities in the metro_driver process.
70 virtual void OnInputSourceChanged(LANGID langid, bool is_ime) = 0;
71
72 private:
73 DISALLOW_COPY_AND_ASSIGN(RemoteInputMethodPrivateWin);
74 };
75
76 } // namespace ui
77
78 #endif // UI_BASE_IME_REMOTE_INPUT_METHOD_WIN_H_
OLDNEW
« no previous file with comments | « ui/base/ime/remote_input_method_delegate_win.h ('k') | ui/base/ime/remote_input_method_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698