| 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 "ui/base/ime/win/mock_tsf_bridge.h" | 5 #include "ui/base/ime/win/mock_tsf_bridge.h" |
| 6 | 6 |
| 7 #include "ui/base/ime/text_input_client.h" | 7 #include "ui/base/ime/text_input_client.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 bool MockTSFBridge::CancelComposition() { | 32 bool MockTSFBridge::CancelComposition() { |
| 33 ++cancel_composition_call_count_; | 33 ++cancel_composition_call_count_; |
| 34 return true; | 34 return true; |
| 35 } | 35 } |
| 36 | 36 |
| 37 void MockTSFBridge::OnTextInputTypeChanged(TextInputClient* client) { | 37 void MockTSFBridge::OnTextInputTypeChanged(TextInputClient* client) { |
| 38 latest_text_input_type_ = client->GetTextInputType(); | 38 latest_text_input_type_ = client->GetTextInputType(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void MockTSFBridge::OnTextLayoutChanged() { | |
| 42 ++on_text_layout_changed_; | |
| 43 } | |
| 44 | |
| 45 void MockTSFBridge::SetFocusedClient(HWND focused_window, | 41 void MockTSFBridge::SetFocusedClient(HWND focused_window, |
| 46 TextInputClient* client) { | 42 TextInputClient* client) { |
| 47 ++set_focused_client_call_count_; | 43 ++set_focused_client_call_count_; |
| 48 focused_window_ = focused_window; | 44 focused_window_ = focused_window; |
| 49 text_input_client_ = client; | 45 text_input_client_ = client; |
| 50 } | 46 } |
| 51 | 47 |
| 52 void MockTSFBridge::RemoveFocusedClient(TextInputClient* client) { | 48 void MockTSFBridge::RemoveFocusedClient(TextInputClient* client) { |
| 53 ++remove_focused_client_call_count_; | 49 ++remove_focused_client_call_count_; |
| 54 DCHECK_EQ(client, text_input_client_); | 50 DCHECK_EQ(client, text_input_client_); |
| 55 text_input_client_ = NULL; | 51 text_input_client_ = NULL; |
| 56 focused_window_ = NULL; | 52 focused_window_ = NULL; |
| 57 } | 53 } |
| 58 | 54 |
| 59 base::win::ScopedComPtr<ITfThreadMgr> MockTSFBridge::GetThreadManager() { | 55 base::win::ScopedComPtr<ITfThreadMgr> MockTSFBridge::GetThreadManager() { |
| 60 return thread_manager_; | 56 return thread_manager_; |
| 61 } | 57 } |
| 62 | 58 |
| 63 TextInputClient* MockTSFBridge::GetFocusedTextInputClient() const { | 59 TextInputClient* MockTSFBridge::GetFocusedTextInputClient() const { |
| 64 return text_input_client_; | 60 return text_input_client_; |
| 65 } | 61 } |
| 66 | 62 |
| 67 void MockTSFBridge::Reset() { | 63 void MockTSFBridge::Reset() { |
| 68 shutdown_call_count_ = 0; | 64 shutdown_call_count_ = 0; |
| 69 enable_ime_call_count_ = 0; | 65 enable_ime_call_count_ = 0; |
| 70 disalbe_ime_call_count_ = 0; | 66 disalbe_ime_call_count_ = 0; |
| 71 cancel_composition_call_count_ = 0; | 67 cancel_composition_call_count_ = 0; |
| 72 on_text_layout_changed_ = 0; | |
| 73 associate_focus_call_count_ = 0; | 68 associate_focus_call_count_ = 0; |
| 74 set_focused_client_call_count_ = 0; | 69 set_focused_client_call_count_ = 0; |
| 75 remove_focused_client_call_count_ = 0; | 70 remove_focused_client_call_count_ = 0; |
| 76 text_input_client_ = NULL; | 71 text_input_client_ = NULL; |
| 77 focused_window_ = NULL; | 72 focused_window_ = NULL; |
| 78 latest_text_input_type_ = TEXT_INPUT_TYPE_NONE; | 73 latest_text_input_type_ = TEXT_INPUT_TYPE_NONE; |
| 79 } | 74 } |
| 80 | 75 |
| 81 } // namespace ui | 76 } // namespace ui |
| OLD | NEW |