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/mock_input_method.h" | 5 #include "ui/base/ime/mock_input_method.h" |
6 | 6 |
7 #include "ui/base/ime/input_method_delegate.h" | 7 #include "ui/base/ime/input_method_delegate.h" |
8 #include "ui/events/event.h" | 8 #include "ui/events/event.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
(...skipping 22 matching lines...) Expand all Loading... |
33 void MockInputMethod::DetachTextInputClient(TextInputClient* client) { | 33 void MockInputMethod::DetachTextInputClient(TextInputClient* client) { |
34 if (text_input_client_ == client) { | 34 if (text_input_client_ == client) { |
35 text_input_client_ = NULL; | 35 text_input_client_ = NULL; |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
39 TextInputClient* MockInputMethod::GetTextInputClient() const { | 39 TextInputClient* MockInputMethod::GetTextInputClient() const { |
40 return text_input_client_; | 40 return text_input_client_; |
41 } | 41 } |
42 | 42 |
43 bool MockInputMethod::DispatchKeyEvent(const ui::KeyEvent& event) { | 43 void MockInputMethod::DispatchKeyEvent(ui::KeyEvent* event) { |
44 return delegate_->DispatchKeyEventPostIME(event); | 44 ignore_result(delegate_->DispatchKeyEventPostIME(event)); |
45 } | 45 } |
46 | 46 |
47 void MockInputMethod::OnFocus() { | 47 void MockInputMethod::OnFocus() { |
48 FOR_EACH_OBSERVER(InputMethodObserver, observer_list_, OnFocus()); | 48 FOR_EACH_OBSERVER(InputMethodObserver, observer_list_, OnFocus()); |
49 } | 49 } |
50 | 50 |
51 void MockInputMethod::OnBlur() { | 51 void MockInputMethod::OnBlur() { |
52 FOR_EACH_OBSERVER(InputMethodObserver, observer_list_, OnBlur()); | 52 FOR_EACH_OBSERVER(InputMethodObserver, observer_list_, OnBlur()); |
53 } | 53 } |
54 | 54 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 void MockInputMethod::AddObserver(InputMethodObserver* observer) { | 111 void MockInputMethod::AddObserver(InputMethodObserver* observer) { |
112 observer_list_.AddObserver(observer); | 112 observer_list_.AddObserver(observer); |
113 } | 113 } |
114 | 114 |
115 void MockInputMethod::RemoveObserver(InputMethodObserver* observer) { | 115 void MockInputMethod::RemoveObserver(InputMethodObserver* observer) { |
116 observer_list_.RemoveObserver(observer); | 116 observer_list_.RemoveObserver(observer); |
117 } | 117 } |
118 | 118 |
119 } // namespace ui | 119 } // namespace ui |
OLD | NEW |