Chromium Code Reviews| 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, | |
| 85 observer_list_, | |
| 86 OnShowImeIfNeeded()); | |
|
Seigo Nonaka
2014/01/09 06:08:43
nit: can be one line?
kevers
2014/01/09 15:29:09
Done.
| |
| 87 } | |
| 88 | |
| 83 void InputMethodBase::AddObserver(InputMethodObserver* observer) { | 89 void InputMethodBase::AddObserver(InputMethodObserver* observer) { |
| 84 observer_list_.AddObserver(observer); | 90 observer_list_.AddObserver(observer); |
| 85 } | 91 } |
| 86 | 92 |
| 87 void InputMethodBase::RemoveObserver(InputMethodObserver* observer) { | 93 void InputMethodBase::RemoveObserver(InputMethodObserver* observer) { |
| 88 observer_list_.RemoveObserver(observer); | 94 observer_list_.RemoveObserver(observer); |
| 89 } | 95 } |
| 90 | 96 |
| 91 bool InputMethodBase::IsTextInputClientFocused(const TextInputClient* client) { | 97 bool InputMethodBase::IsTextInputClientFocused(const TextInputClient* client) { |
| 92 return client && (client == GetTextInputClient()); | 98 return client && (client == GetTextInputClient()); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 if (text_input_client_) | 166 if (text_input_client_) |
| 161 text_input_client_->OnCandidateWindowUpdated(); | 167 text_input_client_->OnCandidateWindowUpdated(); |
| 162 } | 168 } |
| 163 | 169 |
| 164 void InputMethodBase::CandidateWindowHiddenCallback() { | 170 void InputMethodBase::CandidateWindowHiddenCallback() { |
| 165 if (text_input_client_) | 171 if (text_input_client_) |
| 166 text_input_client_->OnCandidateWindowHidden(); | 172 text_input_client_->OnCandidateWindowHidden(); |
| 167 } | 173 } |
| 168 | 174 |
| 169 } // namespace ui | 175 } // namespace ui |
| OLD | NEW |