| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h" | 5 #include "chromeos/dbus/ibus/mock_ibus_input_context_client.h" |
| 6 | 6 |
| 7 namespace chromeos { | 7 namespace chromeos { |
| 8 | 8 |
| 9 MockIBusInputContextClient::MockIBusInputContextClient() | 9 MockIBusInputContextClient::MockIBusInputContextClient() |
| 10 : initialize_call_count_(0), | 10 : initialize_call_count_(0), |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 void MockIBusInputContextClient::Initialize( | 24 void MockIBusInputContextClient::Initialize( |
| 25 dbus::Bus* bus, const dbus::ObjectPath& object_path) { | 25 dbus::Bus* bus, const dbus::ObjectPath& object_path) { |
| 26 initialize_call_count_++; | 26 initialize_call_count_++; |
| 27 is_initialized_ = true; | 27 is_initialized_ = true; |
| 28 } | 28 } |
| 29 | 29 |
| 30 void MockIBusInputContextClient::SetInputContextHandler( | 30 void MockIBusInputContextClient::SetInputContextHandler( |
| 31 IBusInputContextHandlerInterface* handler) { | 31 IBusInputContextHandlerInterface* handler) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 void MockIBusInputContextClient::SetSetCursorLocationHandler( |
| 35 const SetCursorLocationHandler& set_cursor_location_handler) { |
| 36 } |
| 37 |
| 38 void MockIBusInputContextClient::UnsetSetCursorLocationHandler() { |
| 39 } |
| 40 |
| 34 void MockIBusInputContextClient::ResetObjectProxy() { | 41 void MockIBusInputContextClient::ResetObjectProxy() { |
| 35 reset_object_proxy_call_caount_++; | 42 reset_object_proxy_call_caount_++; |
| 36 is_initialized_ = false; | 43 is_initialized_ = false; |
| 37 } | 44 } |
| 38 | 45 |
| 39 bool MockIBusInputContextClient::IsObjectProxyReady() const { | 46 bool MockIBusInputContextClient::IsObjectProxyReady() const { |
| 40 if (is_initialized_) | 47 if (is_initialized_) |
| 41 return true; | 48 return true; |
| 42 else | 49 else |
| 43 return false; | 50 return false; |
| 44 } | 51 } |
| 45 | 52 |
| 46 void MockIBusInputContextClient::SetCapabilities(uint32 capabilities) { | 53 void MockIBusInputContextClient::SetCapabilities(uint32 capabilities) { |
| 47 set_capabilities_call_count_++; | 54 set_capabilities_call_count_++; |
| 48 } | 55 } |
| 49 | 56 |
| 50 void MockIBusInputContextClient::FocusIn() { | 57 void MockIBusInputContextClient::FocusIn() { |
| 51 focus_in_call_count_++; | 58 focus_in_call_count_++; |
| 52 } | 59 } |
| 53 | 60 |
| 54 void MockIBusInputContextClient::FocusOut() { | 61 void MockIBusInputContextClient::FocusOut() { |
| 55 focus_out_call_count_++; | 62 focus_out_call_count_++; |
| 56 } | 63 } |
| 57 | 64 |
| 58 void MockIBusInputContextClient::Reset() { | 65 void MockIBusInputContextClient::Reset() { |
| 59 reset_call_count_++; | 66 reset_call_count_++; |
| 60 } | 67 } |
| 61 | 68 |
| 62 void MockIBusInputContextClient::SetCursorLocation( | 69 void MockIBusInputContextClient::SetCursorLocation( |
| 63 int32 x, int32 y, int32 w, int32 h) { | 70 const ibus::Rect& cursor_location, |
| 71 const ibus::Rect& composition_head) { |
| 64 set_cursor_location_call_count_++; | 72 set_cursor_location_call_count_++; |
| 65 } | 73 } |
| 66 | 74 |
| 67 void MockIBusInputContextClient::ProcessKeyEvent( | 75 void MockIBusInputContextClient::ProcessKeyEvent( |
| 68 uint32 keyval, | 76 uint32 keyval, |
| 69 uint32 keycode, | 77 uint32 keycode, |
| 70 uint32 state, | 78 uint32 state, |
| 71 const ProcessKeyEventCallback& callback, | 79 const ProcessKeyEventCallback& callback, |
| 72 const ErrorCallback& error_callback) { | 80 const ErrorCallback& error_callback) { |
| 73 process_key_event_call_count_++; | 81 process_key_event_call_count_++; |
| 74 if (!process_key_event_handler_.is_null()) { | 82 if (!process_key_event_handler_.is_null()) { |
| 75 process_key_event_handler_.Run(keyval, keycode, state, callback, | 83 process_key_event_handler_.Run(keyval, keycode, state, callback, |
| 76 error_callback); | 84 error_callback); |
| 77 } | 85 } |
| 78 } | 86 } |
| 79 | 87 |
| 80 void MockIBusInputContextClient::SetSurroundingText( | 88 void MockIBusInputContextClient::SetSurroundingText( |
| 81 const std::string& text, | 89 const std::string& text, |
| 82 uint32 cursor_pos, | 90 uint32 cursor_pos, |
| 83 uint32 anchor_pos) { | 91 uint32 anchor_pos) { |
| 84 set_surrounding_text_call_count_++; | 92 set_surrounding_text_call_count_++; |
| 85 set_surrounding_text_handler_.Run(text, cursor_pos, anchor_pos); | 93 set_surrounding_text_handler_.Run(text, cursor_pos, anchor_pos); |
| 86 } | 94 } |
| 87 | 95 |
| 88 void MockIBusInputContextClient::PropertyActivate( | 96 void MockIBusInputContextClient::PropertyActivate( |
| 89 const std::string& key, | 97 const std::string& key, |
| 90 ibus::IBusPropertyState state) { | 98 ibus::IBusPropertyState state) { |
| 91 } | 99 } |
| 92 | 100 |
| 101 bool MockIBusInputContextClient::IsXKBLayout() { |
| 102 return true; |
| 103 } |
| 104 |
| 105 void MockIBusInputContextClient::SetIsXKBLayout(bool is_xkb_layout) { |
| 106 } |
| 107 |
| 93 } // namespace chromeos | 108 } // namespace chromeos |
| OLD | NEW |