OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_ENGINE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_ENGINE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_ENGINE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_ENGINE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 class CompositionText; | 26 class CompositionText; |
27 | 27 |
28 namespace input_method { | 28 namespace input_method { |
29 class CandidateWindow; | 29 class CandidateWindow; |
30 struct KeyEventHandle; | 30 struct KeyEventHandle; |
31 } // namespace input_method | 31 } // namespace input_method |
32 | 32 |
33 class MockInputMethodEngine : public InputMethodEngineInterface { | 33 class MockInputMethodEngine : public InputMethodEngineInterface { |
34 public: | 34 public: |
35 explicit MockInputMethodEngine(); | 35 MockInputMethodEngine(); |
36 virtual ~MockInputMethodEngine(); | 36 virtual ~MockInputMethodEngine(); |
37 | 37 |
38 // InputMethodEngineInterface overrides. | 38 // InputMethodEngineInterface overrides. |
39 virtual const std::string& GetActiveComponentId() const override; | 39 virtual const std::string& GetActiveComponentId() const override; |
40 virtual bool SetComposition(int context_id, | 40 virtual bool SetComposition(int context_id, |
41 const char* text, | 41 const char* text, |
42 int selection_start, | 42 int selection_start, |
43 int selection_end, | 43 int selection_end, |
44 int cursor, | 44 int cursor, |
45 const std::vector<SegmentInfo>& segments, | 45 const std::vector<SegmentInfo>& segments, |
(...skipping 28 matching lines...) Expand all Loading... |
74 virtual void FocusOut() override; | 74 virtual void FocusOut() override; |
75 virtual void Enable(const std::string& component_id) override; | 75 virtual void Enable(const std::string& component_id) override; |
76 virtual void Disable() override; | 76 virtual void Disable() override; |
77 virtual void PropertyActivate(const std::string& property_name) override; | 77 virtual void PropertyActivate(const std::string& property_name) override; |
78 virtual void Reset() override; | 78 virtual void Reset() override; |
79 virtual void ProcessKeyEvent(const ui::KeyEvent& key_event, | 79 virtual void ProcessKeyEvent(const ui::KeyEvent& key_event, |
80 const KeyEventDoneCallback& callback) override; | 80 const KeyEventDoneCallback& callback) override; |
81 virtual void CandidateClicked(uint32 index) override; | 81 virtual void CandidateClicked(uint32 index) override; |
82 virtual void SetSurroundingText(const std::string& text, uint32 cursor_pos, | 82 virtual void SetSurroundingText(const std::string& text, uint32 cursor_pos, |
83 uint32 anchor_pos) override; | 83 uint32 anchor_pos) override; |
| 84 virtual void SetCompositionBounds(const gfx::Rect& bounds) override; |
84 virtual void HideInputView() override; | 85 virtual void HideInputView() override; |
85 | 86 |
86 std::string last_activated_property() const { | 87 std::string last_activated_property() const { |
87 return last_activated_property_; | 88 return last_activated_property_; |
88 } | 89 } |
89 | 90 |
90 private: | 91 private: |
91 std::string active_component_id_; | 92 std::string active_component_id_; |
92 | 93 |
93 // The current candidate window property. | 94 // The current candidate window property. |
94 CandidateWindowProperty candidate_window_property_; | 95 CandidateWindowProperty candidate_window_property_; |
95 | 96 |
96 std::string last_activated_property_; | 97 std::string last_activated_property_; |
97 }; | 98 }; |
98 | 99 |
99 } // namespace chromeos | 100 } // namespace chromeos |
100 | 101 |
101 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_ENGINE_H_ | 102 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_ENGINE_H_ |
OLD | NEW |