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

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

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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
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
5 #ifndef UI_BASE_IME_MOCK_INPUT_METHOD_H_
6 #define UI_BASE_IME_MOCK_INPUT_METHOD_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/observer_list.h"
13 #include "ui/base/ime/input_method.h"
14 #include "ui/base/ime/input_method_observer.h"
15 #include "ui/base/ui_base_export.h"
16
17 namespace ui {
18
19 class KeyEvent;
20 class TextInputClient;
21
22 // A mock ui::InputMethod implementation for testing. You can get the instance
23 // of this class as the global input method with calling
24 // SetUpInputMethodFactoryForTesting() which is declared in
25 // ui/base/ime/input_method_factory.h
26 class UI_BASE_EXPORT MockInputMethod : NON_EXPORTED_BASE(public InputMethod) {
27 public:
28 explicit MockInputMethod(internal::InputMethodDelegate* delegate);
29 ~MockInputMethod() override;
30
31 // Overriden from InputMethod.
32 void SetDelegate(internal::InputMethodDelegate* delegate) override;
33 void Init(bool focused) override;
34 void OnFocus() override;
35 void OnBlur() override;
36 bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
37 NativeEventResult* result) override;
38 void SetFocusedTextInputClient(TextInputClient* client) override;
39 void DetachTextInputClient(TextInputClient* client) override;
40 TextInputClient* GetTextInputClient() const override;
41 bool DispatchKeyEvent(const ui::KeyEvent& event) override;
42 void OnTextInputTypeChanged(const TextInputClient* client) override;
43 void OnCaretBoundsChanged(const TextInputClient* client) override;
44 void CancelComposition(const TextInputClient* client) override;
45 void OnInputLocaleChanged() override;
46 std::string GetInputLocale() override;
47 bool IsActive() override;
48 TextInputType GetTextInputType() const override;
49 TextInputMode GetTextInputMode() const override;
50 bool CanComposeInline() const override;
51 bool IsCandidatePopupOpen() const override;
52 void ShowImeIfNeeded() override;
53 void AddObserver(InputMethodObserver* observer) override;
54 void RemoveObserver(InputMethodObserver* observer) override;
55
56 private:
57 TextInputClient* text_input_client_;
58 ObserverList<InputMethodObserver> observer_list_;
59
60 DISALLOW_COPY_AND_ASSIGN(MockInputMethod);
61 };
62
63 } // namespace ui
64
65 #endif // UI_BASE_IME_MOCK_INPUT_METHOD_H_
OLDNEW
« no previous file with comments | « ui/base/ime/linux/linux_input_method_context_factory.cc ('k') | ui/base/ime/mock_input_method.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698