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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 TextInputMode InputMethodBase::GetTextInputMode() const { | 73 TextInputMode InputMethodBase::GetTextInputMode() const { |
74 TextInputClient* client = GetTextInputClient(); | 74 TextInputClient* client = GetTextInputClient(); |
75 return client ? client->GetTextInputMode() : TEXT_INPUT_MODE_DEFAULT; | 75 return client ? client->GetTextInputMode() : TEXT_INPUT_MODE_DEFAULT; |
76 } | 76 } |
77 | 77 |
78 bool InputMethodBase::CanComposeInline() const { | 78 bool InputMethodBase::CanComposeInline() const { |
79 TextInputClient* client = GetTextInputClient(); | 79 TextInputClient* client = GetTextInputClient(); |
80 return client ? client->CanComposeInline() : true; | 80 return client ? client->CanComposeInline() : true; |
81 } | 81 } |
82 | 82 |
| 83 void InputMethodBase::ShowImeIfNeeded() { |
| 84 FOR_EACH_OBSERVER(InputMethodObserver, observer_list_, OnShowImeIfNeeded()); |
| 85 } |
| 86 |
83 void InputMethodBase::AddObserver(InputMethodObserver* observer) { | 87 void InputMethodBase::AddObserver(InputMethodObserver* observer) { |
84 observer_list_.AddObserver(observer); | 88 observer_list_.AddObserver(observer); |
85 } | 89 } |
86 | 90 |
87 void InputMethodBase::RemoveObserver(InputMethodObserver* observer) { | 91 void InputMethodBase::RemoveObserver(InputMethodObserver* observer) { |
88 observer_list_.RemoveObserver(observer); | 92 observer_list_.RemoveObserver(observer); |
89 } | 93 } |
90 | 94 |
91 bool InputMethodBase::IsTextInputClientFocused(const TextInputClient* client) { | 95 bool InputMethodBase::IsTextInputClientFocused(const TextInputClient* client) { |
92 return client && (client == GetTextInputClient()); | 96 return client && (client == GetTextInputClient()); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 if (text_input_client_) | 164 if (text_input_client_) |
161 text_input_client_->OnCandidateWindowUpdated(); | 165 text_input_client_->OnCandidateWindowUpdated(); |
162 } | 166 } |
163 | 167 |
164 void InputMethodBase::CandidateWindowHiddenCallback() { | 168 void InputMethodBase::CandidateWindowHiddenCallback() { |
165 if (text_input_client_) | 169 if (text_input_client_) |
166 text_input_client_->OnCandidateWindowHidden(); | 170 text_input_client_->OnCandidateWindowHidden(); |
167 } | 171 } |
168 | 172 |
169 } // namespace ui | 173 } // namespace ui |
OLD | NEW |