1 // Copyright 2018 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 #include "chrome/browser/chromeos/arc/input_method_manager/test_input_method_manager_bridge.h"
6 
7 namespace arc {
8 
9 TestInputMethodManagerBridge::TestInputMethodManagerBridge() = default;
10 TestInputMethodManagerBridge::~TestInputMethodManagerBridge() = default;
11 
SendEnableIme(const std::string & ime_id,bool enable,EnableImeCallback callback)12 void TestInputMethodManagerBridge::SendEnableIme(const std::string& ime_id,
13                                                  bool enable,
14                                                  EnableImeCallback callback) {
15   enable_ime_calls_.push_back(std::make_tuple(ime_id, enable));
16   std::move(callback).Run(true);
17 }
18 
SendSwitchImeTo(const std::string & ime_id,SwitchImeToCallback callback)19 void TestInputMethodManagerBridge::SendSwitchImeTo(
20     const std::string& ime_id,
21     SwitchImeToCallback callback) {
22   switch_ime_to_calls_.push_back(ime_id);
23   std::move(callback).Run(true);
24 }
25 
SendFocus(mojo::PendingRemote<mojom::InputConnection> connection,mojom::TextInputStatePtr state)26 void TestInputMethodManagerBridge::SendFocus(
27     mojo::PendingRemote<mojom::InputConnection> connection,
28     mojom::TextInputStatePtr state) {
29   ++focus_calls_count_;
30 }
31 
SendUpdateTextInputState(mojom::TextInputStatePtr state)32 void TestInputMethodManagerBridge::SendUpdateTextInputState(
33     mojom::TextInputStatePtr state) {
34   ++update_text_input_state_calls_count_;
35   last_text_input_state_ = state.Clone();
36 }
37 
SendShowVirtualKeyboard()38 void TestInputMethodManagerBridge::SendShowVirtualKeyboard() {
39   ++show_virtual_keyboard_calls_count_;
40 }
41 
SendHideVirtualKeyboard()42 void TestInputMethodManagerBridge::SendHideVirtualKeyboard() {}
43 
44 }  // namespace arc
45