base: Change DCHECK_IS_ON to a macro DCHECK_IS_ON().
[chromium-blink-merge.git] / ui / views / ime / null_input_method.h
blob1ee130811edd0eaa764e5a65ea90d4bc831b9ca5
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
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_IME_NULL_INPUT_METHOD_H_
6 #define UI_VIEWS_IME_NULL_INPUT_METHOD_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "ui/views/ime/input_method.h"
12 namespace views {
14 // An implementation of views::InputMethod which does nothing.
16 // We're working on removing views::InputMethod{,Base,Bridge} and going to use
17 // only ui::InputMethod. Use this class instead of views::InputMethodBridge
18 // with ui::TextInputFocusManager to effectively eliminate the
19 // views::InputMethod layer.
20 class NullInputMethod : public InputMethod {
21 public:
22 NullInputMethod();
24 // Overridden from InputMethod:
25 void SetDelegate(internal::InputMethodDelegate* delegate) override;
26 void Init(Widget* widget) override;
27 void OnFocus() override;
28 void OnBlur() override;
29 bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
30 NativeEventResult* result) override;
31 void DispatchKeyEvent(const ui::KeyEvent& key) override;
32 void OnTextInputTypeChanged(View* view) override;
33 void OnCaretBoundsChanged(View* view) override;
34 void CancelComposition(View* view) override;
35 void OnInputLocaleChanged() override;
36 std::string GetInputLocale() override;
37 bool IsActive() override;
38 ui::TextInputClient* GetTextInputClient() const override;
39 ui::TextInputType GetTextInputType() const override;
40 bool IsCandidatePopupOpen() const override;
41 void ShowImeIfNeeded() override;
42 bool IsMock() const override;
44 private:
45 DISALLOW_COPY_AND_ASSIGN(NullInputMethod);
48 } // namespace views
50 #endif // UI_VIEWS_IME_NULL_INPUT_METHOD_H_