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

Side by Side Diff: ui/views/mus/input_method_mus.h

Issue 2230393002: IME for Mus: Make InputMethodMus use the IME Mojo API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 4 years, 4 months 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/ime/input_method_base.h" 5 #include "ui/base/ime/input_method_base.h"
6 6
7 #ifndef UI_VIEWS_MUS_INPUT_METHOD_MUS_H_ 7 #ifndef UI_VIEWS_MUS_INPUT_METHOD_MUS_H_
8 #define UI_VIEWS_MUS_INPUT_METHOD_MUS_H_ 8 #define UI_VIEWS_MUS_INPUT_METHOD_MUS_H_
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "mojo/public/cpp/bindings/strong_binding.h"
12 #include "services/shell/public/cpp/connector.h"
13 #include "services/ui/public/interfaces/ime.mojom.h"
11 #include "ui/views/mus/mus_export.h" 14 #include "ui/views/mus/mus_export.h"
12 15
13 namespace ui { 16 namespace ui {
14 class Window; 17 class Window;
15 } // namespace mojo 18 } // namespace mojo
16 19
17 namespace views { 20 namespace views {
18 21
19 class VIEWS_MUS_EXPORT InputMethodMUS : public ui::InputMethodBase { 22 class TextInputClientImpl;
23
24 class VIEWS_MUS_EXPORT InputMethodMus : public ui::InputMethodBase {
20 public: 25 public:
21 InputMethodMUS(ui::internal::InputMethodDelegate* delegate, 26 explicit InputMethodMus(ui::internal::InputMethodDelegate* delegate,
sadrul 2016/08/16 20:01:51 Remove explicit
Hadi 2016/08/16 20:18:25 Done.
22 ui::Window* window); 27 ui::Window* window);
23 ~InputMethodMUS() override; 28 ~InputMethodMus() override;
24 29
25 private: 30 void Init(shell::Connector* connector);
31
26 // Overridden from ui::InputMethod: 32 // Overridden from ui::InputMethod:
27 void OnFocus() override; 33 void OnFocus() override;
28 void OnBlur() override; 34 void OnBlur() override;
29 bool OnUntranslatedIMEMessage(const base::NativeEvent& event, 35 bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
30 NativeEventResult* result) override; 36 NativeEventResult* result) override;
31 void DispatchKeyEvent(ui::KeyEvent* event) override; 37 void DispatchKeyEvent(ui::KeyEvent* event) override;
32 void OnTextInputTypeChanged(const ui::TextInputClient* client) override; 38 void OnTextInputTypeChanged(const ui::TextInputClient* client) override;
33 void OnCaretBoundsChanged(const ui::TextInputClient* client) override; 39 void OnCaretBoundsChanged(const ui::TextInputClient* client) override;
34 void CancelComposition(const ui::TextInputClient* client) override; 40 void CancelComposition(const ui::TextInputClient* client) override;
35 void OnInputLocaleChanged() override; 41 void OnInputLocaleChanged() override;
36 std::string GetInputLocale() override; 42 std::string GetInputLocale() override;
37 bool IsCandidatePopupOpen() const override; 43 bool IsCandidatePopupOpen() const override;
38 44
45 private:
39 // Overridden from ui::InputMethodBase: 46 // Overridden from ui::InputMethodBase:
40 void OnDidChangeFocusedClient(ui::TextInputClient* focused_before, 47 void OnDidChangeFocusedClient(ui::TextInputClient* focused_before,
41 ui::TextInputClient* focused) override; 48 ui::TextInputClient* focused) override;
42 49
43 void UpdateTextInputType(); 50 void UpdateTextInputType();
44 51
45 // The toplevel window which is not owned by this class. 52 // The toplevel window which is not owned by this class.
46 ui::Window* window_; 53 ui::Window* window_;
47 54
48 DISALLOW_COPY_AND_ASSIGN(InputMethodMUS); 55 ui::mojom::IMEServerPtr ime_server_;
56 ui::mojom::InputMethodPtr input_method_;
57 std::unique_ptr<TextInputClientImpl> text_input_client_;
58
59 DISALLOW_COPY_AND_ASSIGN(InputMethodMus);
49 }; 60 };
50 61
51 } // namespace views 62 } // namespace views
52 63
53 #endif // UI_VIEWS_MUS_INPUT_METHOD_MUS_H_ 64 #endif // UI_VIEWS_MUS_INPUT_METHOD_MUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698