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 } | 56 } |
57 | 57 |
58 void MockIMEEngineHandler::SetSurroundingText(const std::string& text, | 58 void MockIMEEngineHandler::SetSurroundingText(const std::string& text, |
59 uint32 cursor_pos, | 59 uint32 cursor_pos, |
60 uint32 anchor_pos) { | 60 uint32 anchor_pos) { |
61 ++set_surrounding_text_call_count_; | 61 ++set_surrounding_text_call_count_; |
62 last_set_surrounding_text_ = text; | 62 last_set_surrounding_text_ = text; |
63 last_set_surrounding_cursor_pos_ = cursor_pos; | 63 last_set_surrounding_cursor_pos_ = cursor_pos; |
64 last_set_surrounding_anchor_pos_ = anchor_pos; | 64 last_set_surrounding_anchor_pos_ = anchor_pos; |
65 } | 65 } |
66 | 66 |
67 } // namespace chromeos | 67 } // namespace chromeos |
OLD | NEW |