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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 void InputMethodBase::OnCaretBoundsChanged(const TextInputClient* client) { | 65 void InputMethodBase::OnCaretBoundsChanged(const TextInputClient* client) { |
66 if (!IsTextInputClientFocused(client)) | 66 if (!IsTextInputClientFocused(client)) |
67 return; | 67 return; |
68 FOR_EACH_OBSERVER(InputMethodObserver, | 68 FOR_EACH_OBSERVER(InputMethodObserver, |
69 observer_list_, | 69 observer_list_, |
70 OnCaretBoundsChanged(client)); | 70 OnCaretBoundsChanged(client)); |
71 } | 71 } |
72 | 72 |
73 void InputMethodBase::OnInputLocaleChanged() { | |
74 FOR_EACH_OBSERVER(InputMethodObserver, | |
75 observer_list_, | |
76 OnInputLocaleChanged()); | |
77 } | |
78 | |
79 TextInputType InputMethodBase::GetTextInputType() const { | 73 TextInputType InputMethodBase::GetTextInputType() const { |
80 TextInputClient* client = GetTextInputClient(); | 74 TextInputClient* client = GetTextInputClient(); |
81 return client ? client->GetTextInputType() : TEXT_INPUT_TYPE_NONE; | 75 return client ? client->GetTextInputType() : TEXT_INPUT_TYPE_NONE; |
82 } | 76 } |
83 | 77 |
84 TextInputMode InputMethodBase::GetTextInputMode() const { | 78 TextInputMode InputMethodBase::GetTextInputMode() const { |
85 TextInputClient* client = GetTextInputClient(); | 79 TextInputClient* client = GetTextInputClient(); |
86 return client ? client->GetTextInputMode() : TEXT_INPUT_MODE_DEFAULT; | 80 return client ? client->GetTextInputMode() : TEXT_INPUT_MODE_DEFAULT; |
87 } | 81 } |
88 | 82 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 TextInputClient* old = text_input_client_; | 131 TextInputClient* old = text_input_client_; |
138 if (old == client) | 132 if (old == client) |
139 return; | 133 return; |
140 OnWillChangeFocusedClient(old, client); | 134 OnWillChangeFocusedClient(old, client); |
141 text_input_client_ = client; // NULL allowed. | 135 text_input_client_ = client; // NULL allowed. |
142 OnDidChangeFocusedClient(old, client); | 136 OnDidChangeFocusedClient(old, client); |
143 NotifyTextInputStateChanged(text_input_client_); | 137 NotifyTextInputStateChanged(text_input_client_); |
144 } | 138 } |
145 | 139 |
146 } // namespace ui | 140 } // namespace ui |
OLD | NEW |