summaryrefslogtreecommitdiffstats
path: root/ui/base/ime/mock_input_method.cc
diff options
context:
space:
mode:
authorkevers@chromium.org <kevers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-03 19:49:32 +0000
committerkevers@chromium.org <kevers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-03 19:49:32 +0000
commit0a6cf0c859d643f4565ce360a1bb6fd747c1f41d (patch)
tree01ae0a2c3fd617c24cfe64fbe569db25829add94 /ui/base/ime/mock_input_method.cc
parentc28f868dfa7b20a12b6f7b7b437dc74c28b85cf0 (diff)
downloadchromium_src-0a6cf0c859d643f4565ce360a1bb6fd747c1f41d.zip
chromium_src-0a6cf0c859d643f4565ce360a1bb6fd747c1f41d.tar.gz
chromium_src-0a6cf0c859d643f4565ce360a1bb6fd747c1f41d.tar.bz2
Fix unsafe typecast in interactive_ui_tests when the virtual keyboard is enabled.
BUG=247746 TEST=interactive_ui_tests: TextInput_TextInputStateChangedTest Review URL: https://codereview.chromium.org/25705003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226820 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/ime/mock_input_method.cc')
-rw-r--r--ui/base/ime/mock_input_method.cc28
1 files changed, 19 insertions, 9 deletions
diff --git a/ui/base/ime/mock_input_method.cc b/ui/base/ime/mock_input_method.cc
index b6323ef..c5fa4e2 100644
--- a/ui/base/ime/mock_input_method.cc
+++ b/ui/base/ime/mock_input_method.cc
@@ -59,35 +59,45 @@ void MockInputMethod::Init(bool focused) {
}
void MockInputMethod::OnFocus() {
- FOR_EACH_OBSERVER(Observer, observer_list_, OnFocus());
+ FOR_EACH_OBSERVER(InputMethodObserver, observer_list_, OnFocus());
}
void MockInputMethod::OnBlur() {
- FOR_EACH_OBSERVER(Observer, observer_list_, OnBlur());
+ FOR_EACH_OBSERVER(InputMethodObserver, observer_list_, OnBlur());
}
bool MockInputMethod::OnUntranslatedIMEMessage(const base::NativeEvent& event,
NativeEventResult* result) {
- FOR_EACH_OBSERVER(Observer, observer_list_, OnUntranslatedIMEMessage(event));
+ FOR_EACH_OBSERVER(InputMethodObserver,
+ observer_list_,
+ OnUntranslatedIMEMessage(event));
if (result)
*result = NativeEventResult();
return false;
}
void MockInputMethod::OnTextInputTypeChanged(const TextInputClient* client) {
- FOR_EACH_OBSERVER(Observer, observer_list_, OnTextInputTypeChanged(client));
- FOR_EACH_OBSERVER(Observer, observer_list_, OnTextInputStateChanged(client));
+ FOR_EACH_OBSERVER(InputMethodObserver,
+ observer_list_,
+ OnTextInputTypeChanged(client));
+ FOR_EACH_OBSERVER(InputMethodObserver,
+ observer_list_,
+ OnTextInputStateChanged(client));
}
void MockInputMethod::OnCaretBoundsChanged(const TextInputClient* client) {
- FOR_EACH_OBSERVER(Observer, observer_list_, OnCaretBoundsChanged(client));
+ FOR_EACH_OBSERVER(InputMethodObserver,
+ observer_list_,
+ OnCaretBoundsChanged(client));
}
void MockInputMethod::CancelComposition(const TextInputClient* client) {
}
void MockInputMethod::OnInputLocaleChanged() {
- FOR_EACH_OBSERVER(Observer, observer_list_, OnInputLocaleChanged());
+ FOR_EACH_OBSERVER(InputMethodObserver,
+ observer_list_,
+ OnInputLocaleChanged());
}
std::string MockInputMethod::GetInputLocale() {
@@ -119,11 +129,11 @@ bool MockInputMethod::IsCandidatePopupOpen() const {
}
void MockInputMethod::AddObserver(InputMethodObserver* observer) {
- observer_list_.AddObserver(static_cast<Observer*>(observer));
+ observer_list_.AddObserver(observer);
}
void MockInputMethod::RemoveObserver(InputMethodObserver* observer) {
- observer_list_.RemoveObserver(static_cast<Observer*>(observer));
+ observer_list_.RemoveObserver(observer);
}
} // namespace ui