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/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/base/ime/input_method_delegate.h" | 8 #include "ui/base/ime/input_method_delegate.h" |
9 #include "ui/base/ime/input_method_observer.h" | 9 #include "ui/base/ime/input_method_observer.h" |
10 #include "ui/base/ime/text_input_client.h" | 10 #include "ui/base/ime/text_input_client.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 void InputMethodBase::OnFocus() { | 35 void InputMethodBase::OnFocus() { |
36 DCHECK(!system_toplevel_window_focused_); | 36 DCHECK(!system_toplevel_window_focused_); |
37 system_toplevel_window_focused_ = true; | 37 system_toplevel_window_focused_ = true; |
38 } | 38 } |
39 | 39 |
40 void InputMethodBase::OnBlur() { | 40 void InputMethodBase::OnBlur() { |
41 DCHECK(system_toplevel_window_focused_); | 41 DCHECK(system_toplevel_window_focused_); |
42 system_toplevel_window_focused_ = false; | 42 system_toplevel_window_focused_ = false; |
43 } | 43 } |
44 | 44 |
| 45 void InputMethodBase::OnPossibleRefocus() { |
| 46 NotifyTextInputStateChanged(text_input_client_); |
| 47 } |
| 48 |
45 void InputMethodBase::SetFocusedTextInputClient(TextInputClient* client) { | 49 void InputMethodBase::SetFocusedTextInputClient(TextInputClient* client) { |
46 TextInputClient* old = text_input_client_; | 50 TextInputClient* old = text_input_client_; |
47 OnWillChangeFocusedClient(old, client); | 51 OnWillChangeFocusedClient(old, client); |
48 text_input_client_ = client; // NULL allowed. | 52 text_input_client_ = client; // NULL allowed. |
49 OnDidChangeFocusedClient(old, client); | 53 OnDidChangeFocusedClient(old, client); |
50 | 54 |
51 if (old != text_input_client_) | 55 if (old != text_input_client_) |
52 NotifyTextInputStateChanged(text_input_client_); | 56 NotifyTextInputStateChanged(text_input_client_); |
53 } | 57 } |
54 | 58 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 111 } |
108 | 112 |
109 void InputMethodBase::NotifyTextInputStateChanged( | 113 void InputMethodBase::NotifyTextInputStateChanged( |
110 const TextInputClient* client) { | 114 const TextInputClient* client) { |
111 FOR_EACH_OBSERVER(InputMethodObserver, | 115 FOR_EACH_OBSERVER(InputMethodObserver, |
112 observer_list_, | 116 observer_list_, |
113 OnTextInputStateChanged(client)); | 117 OnTextInputStateChanged(client)); |
114 } | 118 } |
115 | 119 |
116 } // namespace ui | 120 } // namespace ui |
OLD | NEW |