| 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/input_method_base.h" | 5 #include "ui/base/ime/input_method_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "ui/base/ime/input_method_delegate.h" | 10 #include "ui/base/ime/input_method_delegate.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 TextInputClient* client = GetTextInputClient(); | 104 TextInputClient* client = GetTextInputClient(); |
| 105 if (!IsTextInputTypeNone()) | 105 if (!IsTextInputTypeNone()) |
| 106 client->OnInputMethodChanged(); | 106 client->OnInputMethodChanged(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool InputMethodBase::DispatchKeyEventPostIME( | 109 bool InputMethodBase::DispatchKeyEventPostIME( |
| 110 const ui::KeyEvent& event) const { | 110 const ui::KeyEvent& event) const { |
| 111 if (!delegate_) | 111 if (!delegate_) |
| 112 return false; | 112 return false; |
| 113 | 113 |
| 114 if (!event.HasNativeEvent()) | 114 return delegate_->DispatchKeyEventPostIME(event); |
| 115 return delegate_->DispatchFabricatedKeyEventPostIME( | |
| 116 event.type(), event.key_code(), event.flags()); | |
| 117 | |
| 118 return delegate_->DispatchKeyEventPostIME(event.native_event()); | |
| 119 } | 115 } |
| 120 | 116 |
| 121 void InputMethodBase::NotifyTextInputStateChanged( | 117 void InputMethodBase::NotifyTextInputStateChanged( |
| 122 const TextInputClient* client) { | 118 const TextInputClient* client) { |
| 123 FOR_EACH_OBSERVER(InputMethodObserver, | 119 FOR_EACH_OBSERVER(InputMethodObserver, |
| 124 observer_list_, | 120 observer_list_, |
| 125 OnTextInputStateChanged(client)); | 121 OnTextInputStateChanged(client)); |
| 126 } | 122 } |
| 127 | 123 |
| 128 void InputMethodBase::SetFocusedTextInputClientInternal( | 124 void InputMethodBase::SetFocusedTextInputClientInternal( |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 if (text_input_client_) | 160 if (text_input_client_) |
| 165 text_input_client_->OnCandidateWindowUpdated(); | 161 text_input_client_->OnCandidateWindowUpdated(); |
| 166 } | 162 } |
| 167 | 163 |
| 168 void InputMethodBase::CandidateWindowHiddenCallback() { | 164 void InputMethodBase::CandidateWindowHiddenCallback() { |
| 169 if (text_input_client_) | 165 if (text_input_client_) |
| 170 text_input_client_->OnCandidateWindowHidden(); | 166 text_input_client_->OnCandidateWindowHidden(); |
| 171 } | 167 } |
| 172 | 168 |
| 173 } // namespace ui | 169 } // namespace ui |
| OLD | NEW |