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

Side by Side Diff: ui/base/ime/mock_ibus_client.h

Issue 10656017: Clean UP: Remove IBusClientImpl from ui/base/ime/* (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix WinAura Created 8 years, 5 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
« no previous file with comments | « ui/base/ime/input_method_ibus_unittest.cc ('k') | ui/base/ime/mock_ibus_client.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 (c) 2012 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 // TODO(nona): Remove this file.
5
6 #ifndef UI_BASE_IME_MOCK_IBUS_CLIENT_H_
7 #define UI_BASE_IME_MOCK_IBUS_CLIENT_H_
8 #pragma once
9
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "ui/base/ime/composition_text.h"
13 #include "ui/base/ime/ibus_client.h"
14
15 namespace ui {
16 namespace internal {
17
18 // A dummy IBusClient implementation for testing which requires neither
19 // ibus-daemon nor ibus header files.
20 class UI_EXPORT MockIBusClient : public IBusClient {
21 public:
22 MockIBusClient();
23 virtual ~MockIBusClient();
24
25 // ui::internal::IBusClient overrides:
26 virtual bool IsConnected() OVERRIDE;
27 virtual bool IsContextReady() OVERRIDE;
28 virtual void CreateContext(PendingCreateICRequest* request) OVERRIDE;
29 virtual void DestroyProxy() OVERRIDE;
30 virtual void SetCapabilities(
31 InlineCompositionCapability inline_type) OVERRIDE;
32 virtual void FocusIn() OVERRIDE;
33 virtual void FocusOut() OVERRIDE;
34 virtual void Reset() OVERRIDE;
35 virtual InputMethodType GetInputMethodType() OVERRIDE;
36 virtual void SetCursorLocation(const gfx::Rect& cursor_location,
37 const gfx::Rect& composition_head) OVERRIDE;
38 virtual void SendKeyEvent(
39 uint32 keyval,
40 uint32 keycode,
41 uint32 state,
42 const chromeos::IBusInputContextClient::ProcessKeyEventCallback&
43 cb) OVERRIDE;
44 // See comments in CreateContext().
45 enum CreateContextResult {
46 kCreateContextSuccess,
47 kCreateContextFail,
48 kCreateContextNoResponse,
49 kCreateContextDelayed,
50 };
51
52 // Resets all member variables below to the initial state.
53 void ResetFlags();
54
55 // Controls the behavior of CreateContext().
56 CreateContextResult create_context_result_;
57 scoped_ptr<PendingCreateICRequest> create_ic_request_;
58
59 // A value which IsConnected() will return.
60 bool is_connected_;
61 // A value which IsContextReady() will return.
62 bool is_context_ready_;
63 // A value which GetInputMethodType() will return.
64 InputMethodType input_method_type_;
65 // A text which ExtractCommitText() will return.
66 string16 commit_text_;
67
68 unsigned int create_context_call_count_;
69 unsigned int destroy_proxy_call_count_;
70 unsigned int set_capabilities_call_count_;
71 unsigned int focus_in_call_count_;
72 unsigned int focus_out_call_count_;
73 unsigned int reset_call_count_;
74 unsigned int set_cursor_location_call_count_;
75
76 private:
77 DISALLOW_COPY_AND_ASSIGN(MockIBusClient);
78 };
79
80 } // namespace internal
81 } // namespace ui
82
83 #endif // UI_BASE_IME_MOCK_IBUS_CLIENT_H_
OLDNEW
« no previous file with comments | « ui/base/ime/input_method_ibus_unittest.cc ('k') | ui/base/ime/mock_ibus_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698