| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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_AURA_TEST_MUS_INPUT_METHOD_MUS_TEST_API_H_ |
| 6 #define UI_AURA_TEST_MUS_INPUT_METHOD_MUS_TEST_API_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "ui/aura/mus/input_method_mus.h" |
| 10 |
| 11 namespace aura { |
| 12 |
| 13 class InputMethodMusTestApi { |
| 14 public: |
| 15 static void SetInputMethod(InputMethodMus* input_method_mus, |
| 16 ui::mojom::InputMethod* input_method) { |
| 17 input_method_mus->input_method_ = input_method; |
| 18 } |
| 19 |
| 20 static void CallSendKeyEventToInputMethod( |
| 21 InputMethodMus* input_method_mus, |
| 22 const ui::KeyEvent& event, |
| 23 std::unique_ptr<InputMethodMus::EventResultCallback> ack_callback) { |
| 24 input_method_mus->SendKeyEventToInputMethod(event, std::move(ack_callback)); |
| 25 } |
| 26 |
| 27 static void Disable(InputMethodMus* input_method) { |
| 28 DCHECK(input_method->pending_callbacks_.empty()); |
| 29 input_method->ime_server_.reset(); |
| 30 } |
| 31 |
| 32 private: |
| 33 DISALLOW_IMPLICIT_CONSTRUCTORS(InputMethodMusTestApi); |
| 34 }; |
| 35 |
| 36 } // namespace aura |
| 37 |
| 38 #endif // UI_AURA_TEST_MUS_INPUT_METHOD_MUS_TEST_API_H_ |
| OLD | NEW |