| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/base/ime/chromeos/mock_ime_engine_handler.h" | 5 #include "ui/base/ime/chromeos/mock_ime_engine_handler.h" |
| 6 | 6 |
| 7 namespace chromeos { | 7 namespace chromeos { |
| 8 | 8 |
| 9 MockIMEEngineHandler::MockIMEEngineHandler() | 9 MockIMEEngineHandler::MockIMEEngineHandler() |
| 10 : focus_in_call_count_(0), | 10 : focus_in_call_count_(0), |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 void MockIMEEngineHandler::Reset() { | 43 void MockIMEEngineHandler::Reset() { |
| 44 ++reset_call_count_; | 44 ++reset_call_count_; |
| 45 } | 45 } |
| 46 | 46 |
| 47 void MockIMEEngineHandler::ProcessKeyEvent( | 47 void MockIMEEngineHandler::ProcessKeyEvent( |
| 48 const ui::KeyEvent& key_event, | 48 const ui::KeyEvent& key_event, |
| 49 const KeyEventDoneCallback& callback) { | 49 const KeyEventDoneCallback& callback) { |
| 50 ++process_key_event_call_count_; | 50 ++process_key_event_call_count_; |
| 51 last_processed_key_event_.reset(key_event.Copy()); | 51 last_processed_key_event_.reset(new ui::KeyEvent(key_event)); |
| 52 last_passed_callback_ = callback; | 52 last_passed_callback_ = callback; |
| 53 } | 53 } |
| 54 | 54 |
| 55 void MockIMEEngineHandler::CandidateClicked(uint32 index, | 55 void MockIMEEngineHandler::CandidateClicked(uint32 index, |
| 56 ibus::IBusMouseButton button, | 56 ibus::IBusMouseButton button, |
| 57 uint32 state) { | 57 uint32 state) { |
| 58 } | 58 } |
| 59 | 59 |
| 60 void MockIMEEngineHandler::SetSurroundingText(const std::string& text, | 60 void MockIMEEngineHandler::SetSurroundingText(const std::string& text, |
| 61 uint32 cursor_pos, | 61 uint32 cursor_pos, |
| 62 uint32 anchor_pos) { | 62 uint32 anchor_pos) { |
| 63 ++set_surrounding_text_call_count_; | 63 ++set_surrounding_text_call_count_; |
| 64 last_set_surrounding_text_ = text; | 64 last_set_surrounding_text_ = text; |
| 65 last_set_surrounding_cursor_pos_ = cursor_pos; | 65 last_set_surrounding_cursor_pos_ = cursor_pos; |
| 66 last_set_surrounding_anchor_pos_ = anchor_pos; | 66 last_set_surrounding_anchor_pos_ = anchor_pos; |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace chromeos | 69 } // namespace chromeos |
| OLD | NEW |