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

Side by Side Diff: chrome/browser/chromeos/input_method/mock_input_method_engine.h

Issue 641243005: Support a private event - inputMethodPrivate.onCompositionBoundsChanged so that component IME exten… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits + unit test Created 6 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
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698