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

Side by Side Diff: chromeos/ime/mock_ime_candidate_window_handler.h

Issue 23822002: Adding new mock classes for input method handlers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chromeos/chromeos.gyp ('k') | chromeos/ime/mock_ime_candidate_window_handler.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 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 CHROMEOS_IME_MOCK_IME_CANDIDATE_WINDOW_HANDLER_H_
6 #define CHROMEOS_IME_MOCK_IME_CANDIDATE_WINDOW_HANDLER_H_
7
8 #include "chromeos/dbus/ibus/ibus_lookup_table.h"
9 #include "chromeos/ime/ibus_bridge.h"
10
11 namespace chromeos {
12
13 class MockIMECandidateWindowHandler
14 : public IBusPanelCandidateWindowHandlerInterface {
15 public:
16 struct UpdateLookupTableArg {
17 IBusLookupTable lookup_table;
18 bool is_visible;
19 };
20
21 struct UpdateAuxiliaryTextArg {
22 std::string text;
23 bool is_visible;
24 };
25
26 MockIMECandidateWindowHandler();
27 virtual ~MockIMECandidateWindowHandler();
28
29 // IBusPanelCandidateWindowHandlerInterface override.
30 virtual void UpdateLookupTable(const IBusLookupTable& table,
31 bool visible) OVERRIDE;
32 virtual void HideLookupTable() OVERRIDE;
33 virtual void UpdateAuxiliaryText(const std::string& text,
34 bool visible) OVERRIDE;
35 virtual void HideAuxiliaryText() OVERRIDE;
36 virtual void UpdatePreeditText(const std::string& text, uint32 cursor_pos,
37 bool visible) OVERRIDE;
38 virtual void HidePreeditText() OVERRIDE;
39 virtual void SetCursorLocation(const ibus::Rect& cursor_location,
40 const ibus::Rect& composition_head) OVERRIDE;
41
42 int set_cursor_location_call_count() const {
43 return set_cursor_location_call_count_;
44 }
45
46 int update_lookup_table_call_count() const {
47 return update_lookup_table_call_count_;
48 }
49
50 int update_auxiliary_text_call_count() const {
51 return update_auxiliary_text_call_count_;
52 }
53
54 const UpdateLookupTableArg& last_update_lookup_table_arg() {
55 return last_update_lookup_table_arg_;
56 }
57
58 const UpdateAuxiliaryTextArg& last_update_auxiliary_text_arg() {
59 return last_update_auxiliary_text_arg_;
60 }
61
62 // Resets all call count.
63 void Reset();
64
65 private:
66 int set_cursor_location_call_count_;
67 int update_lookup_table_call_count_;
68 int update_auxiliary_text_call_count_;
69 UpdateLookupTableArg last_update_lookup_table_arg_;
70 UpdateAuxiliaryTextArg last_update_auxiliary_text_arg_;
71 };
72
73 } // namespace chromeos
74
75 #endif // CHROMEOS_IME_MOCK_IME_CANDIDATE_WINDOW_HANDLER_H_
OLDNEW
« no previous file with comments | « chromeos/chromeos.gyp ('k') | chromeos/ime/mock_ime_candidate_window_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698