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/views/ime/input_method_bridge.h" | 5 #include "ui/views/ime/input_method_bridge.h" |
6 | 6 |
7 #include "ui/base/events/event.h" | 7 #include "ui/base/events/event.h" |
8 #include "ui/base/ime/input_method.h" | 8 #include "ui/base/ime/input_method.h" |
9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 client->OnInputMethodChanged(); | 206 client->OnInputMethodChanged(); |
207 } | 207 } |
208 | 208 |
209 bool InputMethodBridge::ChangeTextDirectionAndLayoutAlignment( | 209 bool InputMethodBridge::ChangeTextDirectionAndLayoutAlignment( |
210 base::i18n::TextDirection direction) { | 210 base::i18n::TextDirection direction) { |
211 TextInputClient* client = GetTextInputClient(); | 211 TextInputClient* client = GetTextInputClient(); |
212 return client ? | 212 return client ? |
213 client->ChangeTextDirectionAndLayoutAlignment(direction) : false; | 213 client->ChangeTextDirectionAndLayoutAlignment(direction) : false; |
214 } | 214 } |
215 | 215 |
| 216 void InputMethodBridge::ExtendSelectionAndDelete(size_t before, size_t after) { |
| 217 TextInputClient* client = GetTextInputClient(); |
| 218 if (client) |
| 219 client->ExtendSelectionAndDelete(before, after); |
| 220 } |
| 221 |
216 // Overridden from FocusChangeListener. | 222 // Overridden from FocusChangeListener. |
217 void InputMethodBridge::OnWillChangeFocus(View* focused_before, View* focused) { | 223 void InputMethodBridge::OnWillChangeFocus(View* focused_before, View* focused) { |
218 ConfirmCompositionText(); | 224 ConfirmCompositionText(); |
219 } | 225 } |
220 | 226 |
221 void InputMethodBridge::OnDidChangeFocus(View* focused_before, View* focused) { | 227 void InputMethodBridge::OnDidChangeFocus(View* focused_before, View* focused) { |
222 OnTextInputTypeChanged(GetFocusedView()); | 228 OnTextInputTypeChanged(GetFocusedView()); |
223 OnCaretBoundsChanged(GetFocusedView()); | 229 OnCaretBoundsChanged(GetFocusedView()); |
224 } | 230 } |
225 | 231 |
226 } // namespace views | 232 } // namespace views |
OLD | NEW |