| 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 namespace ui { | 7 namespace ui { |
| 8 | 8 |
| 9 MockInputMethod::MockInputMethod(internal::InputMethodDelegate* delegate) | 9 MockInputMethod::MockInputMethod(internal::InputMethodDelegate* delegate) |
| 10 : text_input_client_(NULL) { | 10 : text_input_client_(NULL) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 void MockInputMethod::OnFocus() { | 42 void MockInputMethod::OnFocus() { |
| 43 FOR_EACH_OBSERVER(Observer, observer_list_, OnFocus()); | 43 FOR_EACH_OBSERVER(Observer, observer_list_, OnFocus()); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void MockInputMethod::OnBlur() { | 46 void MockInputMethod::OnBlur() { |
| 47 FOR_EACH_OBSERVER(Observer, observer_list_, OnBlur()); | 47 FOR_EACH_OBSERVER(Observer, observer_list_, OnBlur()); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void MockInputMethod::OnPossibleRefocus() { |
| 51 FOR_EACH_OBSERVER(Observer, observer_list_, OnPossibleRefocus()); |
| 52 } |
| 53 |
| 50 bool MockInputMethod::OnUntranslatedIMEMessage(const base::NativeEvent& event, | 54 bool MockInputMethod::OnUntranslatedIMEMessage(const base::NativeEvent& event, |
| 51 NativeEventResult* result) { | 55 NativeEventResult* result) { |
| 52 FOR_EACH_OBSERVER(Observer, observer_list_, OnUntranslatedIMEMessage(event)); | 56 FOR_EACH_OBSERVER(Observer, observer_list_, OnUntranslatedIMEMessage(event)); |
| 53 if (result) | 57 if (result) |
| 54 *result = NativeEventResult(); | 58 *result = NativeEventResult(); |
| 55 return false; | 59 return false; |
| 56 } | 60 } |
| 57 | 61 |
| 58 void MockInputMethod::OnTextInputTypeChanged(const TextInputClient* client) { | 62 void MockInputMethod::OnTextInputTypeChanged(const TextInputClient* client) { |
| 59 FOR_EACH_OBSERVER(Observer, observer_list_, OnTextInputTypeChanged(client)); | 63 FOR_EACH_OBSERVER(Observer, observer_list_, OnTextInputTypeChanged(client)); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 101 |
| 98 void MockInputMethod::AddObserver(InputMethodObserver* observer) { | 102 void MockInputMethod::AddObserver(InputMethodObserver* observer) { |
| 99 observer_list_.AddObserver(static_cast<Observer*>(observer)); | 103 observer_list_.AddObserver(static_cast<Observer*>(observer)); |
| 100 } | 104 } |
| 101 | 105 |
| 102 void MockInputMethod::RemoveObserver(InputMethodObserver* observer) { | 106 void MockInputMethod::RemoveObserver(InputMethodObserver* observer) { |
| 103 observer_list_.RemoveObserver(static_cast<Observer*>(observer)); | 107 observer_list_.RemoveObserver(static_cast<Observer*>(observer)); |
| 104 } | 108 } |
| 105 | 109 |
| 106 } // namespace ui | 110 } // namespace ui |
| OLD | NEW |