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 18 matching lines...) Expand all Loading... |
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 explicit 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, |
46 std::string* error) OVERRIDE; | 46 std::string* error) override; |
47 virtual bool ClearComposition(int context_id, std::string* error) OVERRIDE; | 47 virtual bool ClearComposition(int context_id, std::string* error) override; |
48 virtual bool CommitText(int context_id, const char* text, | 48 virtual bool CommitText(int context_id, const char* text, |
49 std::string* error) OVERRIDE; | 49 std::string* error) override; |
50 virtual bool SendKeyEvents(int context_id, | 50 virtual bool SendKeyEvents(int context_id, |
51 const std::vector<KeyboardEvent>& events) OVERRIDE; | 51 const std::vector<KeyboardEvent>& events) override; |
52 virtual const CandidateWindowProperty& | 52 virtual const CandidateWindowProperty& |
53 GetCandidateWindowProperty() const OVERRIDE; | 53 GetCandidateWindowProperty() const override; |
54 virtual void SetCandidateWindowProperty( | 54 virtual void SetCandidateWindowProperty( |
55 const CandidateWindowProperty& property) OVERRIDE; | 55 const CandidateWindowProperty& property) override; |
56 virtual bool SetCandidateWindowVisible(bool visible, | 56 virtual bool SetCandidateWindowVisible(bool visible, |
57 std::string* error) OVERRIDE; | 57 std::string* error) override; |
58 virtual bool SetCandidates(int context_id, | 58 virtual bool SetCandidates(int context_id, |
59 const std::vector<Candidate>& candidates, | 59 const std::vector<Candidate>& candidates, |
60 std::string* error) OVERRIDE; | 60 std::string* error) override; |
61 virtual bool SetCursorPosition(int context_id, int candidate_id, | 61 virtual bool SetCursorPosition(int context_id, int candidate_id, |
62 std::string* error) OVERRIDE; | 62 std::string* error) override; |
63 virtual bool SetMenuItems(const std::vector<MenuItem>& items) OVERRIDE; | 63 virtual bool SetMenuItems(const std::vector<MenuItem>& items) override; |
64 virtual bool UpdateMenuItems(const std::vector<MenuItem>& items) OVERRIDE; | 64 virtual bool UpdateMenuItems(const std::vector<MenuItem>& items) override; |
65 virtual bool IsActive() const OVERRIDE; | 65 virtual bool IsActive() const override; |
66 virtual bool DeleteSurroundingText(int context_id, | 66 virtual bool DeleteSurroundingText(int context_id, |
67 int offset, | 67 int offset, |
68 size_t number_of_chars, | 68 size_t number_of_chars, |
69 std::string* error) OVERRIDE; | 69 std::string* error) override; |
70 | 70 |
71 // IMEEngineHandlerInterface overrides. | 71 // IMEEngineHandlerInterface overrides. |
72 virtual void FocusIn( | 72 virtual void FocusIn( |
73 const IMEEngineHandlerInterface::InputContext& input_context) OVERRIDE; | 73 const IMEEngineHandlerInterface::InputContext& input_context) override; |
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 HideInputView() OVERRIDE; | 84 virtual void HideInputView() override; |
85 | 85 |
86 std::string last_activated_property() const { | 86 std::string last_activated_property() const { |
87 return last_activated_property_; | 87 return last_activated_property_; |
88 } | 88 } |
89 | 89 |
90 private: | 90 private: |
91 std::string active_component_id_; | 91 std::string active_component_id_; |
92 | 92 |
93 // The current candidate window property. | 93 // The current candidate window property. |
94 CandidateWindowProperty candidate_window_property_; | 94 CandidateWindowProperty candidate_window_property_; |
95 | 95 |
96 std::string last_activated_property_; | 96 std::string last_activated_property_; |
97 }; | 97 }; |
98 | 98 |
99 } // namespace chromeos | 99 } // namespace chromeos |
100 | 100 |
101 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_ENGINE_H_ | 101 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_INPUT_METHOD_ENGINE_H_ |
OLD | NEW |