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 "chrome/browser/chromeos/input_method/input_method_manager_impl.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h" |
6 | 6 |
7 #include <algorithm> // std::find | 7 #include <algorithm> // std::find |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 new_active_input_method_ids.push_back(input_method_id); | 208 new_active_input_method_ids.push_back(input_method_id); |
209 | 209 |
210 return true; | 210 return true; |
211 } | 211 } |
212 | 212 |
213 // Starts or stops the system input method framework as needed. | 213 // Starts or stops the system input method framework as needed. |
214 void InputMethodManagerImpl::ReconfigureIMFramework() { | 214 void InputMethodManagerImpl::ReconfigureIMFramework() { |
215 if (component_extension_ime_manager_->IsInitialized()) | 215 if (component_extension_ime_manager_->IsInitialized()) |
216 LoadNecessaryComponentExtensions(); | 216 LoadNecessaryComponentExtensions(); |
217 | 217 |
218 if (ContainsOnlyKeyboardLayout(active_input_method_ids_)) { | 218 const bool keyboard_layout_only = |
219 ContainsOnlyKeyboardLayout(active_input_method_ids_); | |
220 | |
221 // Initialize candidate window controller and widgets such as | |
222 // candidate window, infolist and mode indicator. Note, mode | |
223 // indicator is used by only keyboard layout input methods. | |
224 if (!keyboard_layout_only || active_input_method_ids_.size() > 1) { | |
225 MaybeInitializeCandidateWindowController(); | |
226 } | |
227 | |
228 if (keyboard_layout_only) { | |
219 // Do NOT call ibus_controller_->Stop(); here to work around a crash issue | 229 // Do NOT call ibus_controller_->Stop(); here to work around a crash issue |
Seigo Nonaka
2013/11/06 02:47:08
This comment makes no sense now.
Please remove thi
| |
220 // at crbug.com/27051. | 230 // at crbug.com/27051. |
221 // TODO(yusukes): We can safely call Stop(); here once crbug.com/26443 | 231 // TODO(yusukes): We can safely call Stop(); here once crbug.com/26443 |
222 // is implemented. | 232 // is implemented. |
223 } else { | 233 } else { |
224 MaybeInitializeCandidateWindowController(); | |
225 IBusDaemonController::GetInstance()->Start(); | 234 IBusDaemonController::GetInstance()->Start(); |
226 } | 235 } |
227 } | 236 } |
228 | 237 |
229 bool InputMethodManagerImpl::EnableInputMethod( | 238 bool InputMethodManagerImpl::EnableInputMethod( |
230 const std::string& input_method_id) { | 239 const std::string& input_method_id) { |
231 if (!EnableInputMethodImpl(input_method_id, active_input_method_ids_)) | 240 if (!EnableInputMethodImpl(input_method_id, active_input_method_ids_)) |
232 return false; | 241 return false; |
233 | 242 |
234 ReconfigureIMFramework(); | 243 ReconfigureIMFramework(); |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
862 else | 871 else |
863 DVLOG(1) << "Failed to initialize the candidate window controller"; | 872 DVLOG(1) << "Failed to initialize the candidate window controller"; |
864 } | 873 } |
865 | 874 |
866 bool InputMethodManagerImpl::IsIBusConnectionAlive() { | 875 bool InputMethodManagerImpl::IsIBusConnectionAlive() { |
867 return DBusThreadManager::Get() && DBusThreadManager::Get()->GetIBusClient(); | 876 return DBusThreadManager::Get() && DBusThreadManager::Get()->GetIBusClient(); |
868 } | 877 } |
869 | 878 |
870 } // namespace input_method | 879 } // namespace input_method |
871 } // namespace chromeos | 880 } // namespace chromeos |
OLD | NEW |