| 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/ime/input_method.h" | 7 #include "ui/base/ime/input_method.h" |
| 8 #include "ui/base/ime/input_method_observer.h" | 8 #include "ui/base/ime/input_method_observer.h" |
| 9 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
| 10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 if (client) | 304 if (client) |
| 305 client->ExtendSelectionAndDelete(before, after); | 305 client->ExtendSelectionAndDelete(before, after); |
| 306 } | 306 } |
| 307 | 307 |
| 308 void InputMethodBridge::EnsureCaretInRect(const gfx::Rect& rect) { | 308 void InputMethodBridge::EnsureCaretInRect(const gfx::Rect& rect) { |
| 309 TextInputClient* client = GetTextInputClient(); | 309 TextInputClient* client = GetTextInputClient(); |
| 310 if (client) | 310 if (client) |
| 311 client->EnsureCaretInRect(rect); | 311 client->EnsureCaretInRect(rect); |
| 312 } | 312 } |
| 313 | 313 |
| 314 void InputMethodBridge::OnCandidateWindowShow() { |
| 315 TextInputClient* client = GetTextInputClient(); |
| 316 if (client) |
| 317 client->OnCandidateWindowShow(); |
| 318 } |
| 319 |
| 320 void InputMethodBridge::OnCandidateWindowUpdate() { |
| 321 TextInputClient* client = GetTextInputClient(); |
| 322 if (client) |
| 323 client->OnCandidateWindowUpdate(); |
| 324 } |
| 325 |
| 326 void InputMethodBridge::OnCandidateWindowHide() { |
| 327 TextInputClient* client = GetTextInputClient(); |
| 328 if (client) |
| 329 client->OnCandidateWindowHide(); |
| 330 } |
| 331 |
| 314 // Overridden from FocusChangeListener. | 332 // Overridden from FocusChangeListener. |
| 315 void InputMethodBridge::OnWillChangeFocus(View* focused_before, View* focused) { | 333 void InputMethodBridge::OnWillChangeFocus(View* focused_before, View* focused) { |
| 316 if (HasCompositionText()) { | 334 if (HasCompositionText()) { |
| 317 ConfirmCompositionText(); | 335 ConfirmCompositionText(); |
| 318 CancelComposition(focused_before); | 336 CancelComposition(focused_before); |
| 319 } | 337 } |
| 320 } | 338 } |
| 321 | 339 |
| 322 void InputMethodBridge::OnDidChangeFocus(View* focused_before, View* focused) { | 340 void InputMethodBridge::OnDidChangeFocus(View* focused_before, View* focused) { |
| 323 DCHECK_EQ(GetFocusedView(), focused); | 341 DCHECK_EQ(GetFocusedView(), focused); |
| 324 OnTextInputTypeChanged(focused); | 342 OnTextInputTypeChanged(focused); |
| 325 OnCaretBoundsChanged(focused); | 343 OnCaretBoundsChanged(focused); |
| 326 } | 344 } |
| 327 | 345 |
| 328 ui::InputMethod* InputMethodBridge::GetHostInputMethod() const { | 346 ui::InputMethod* InputMethodBridge::GetHostInputMethod() const { |
| 329 return host_; | 347 return host_; |
| 330 } | 348 } |
| 331 | 349 |
| 332 | 350 |
| 333 } // namespace views | 351 } // namespace views |
| OLD | NEW |