| 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 "ash/ime/input_method_menu_item.h" | 9 #include "ash/ime/input_method_menu_item.h" |
| 10 #include "ash/ime/input_method_menu_manager.h" | 10 #include "ash/ime/input_method_menu_manager.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 container.end(); | 43 container.end(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 bool InputMethodManagerImpl::IsLoginKeyboard( | 48 bool InputMethodManagerImpl::IsLoginKeyboard( |
| 49 const std::string& layout) const { | 49 const std::string& layout) const { |
| 50 return util_.IsLoginKeyboard(layout); | 50 return util_.IsLoginKeyboard(layout); |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool InputMethodManagerImpl::MigrateXkbInputMethods( |
| 54 std::vector<std::string>* input_method_ids) { |
| 55 return util_.MigrateXkbInputMethods(input_method_ids); |
| 56 } |
| 57 |
| 53 InputMethodManagerImpl::InputMethodManagerImpl( | 58 InputMethodManagerImpl::InputMethodManagerImpl( |
| 54 scoped_ptr<InputMethodDelegate> delegate) | 59 scoped_ptr<InputMethodDelegate> delegate) |
| 55 : delegate_(delegate.Pass()), | 60 : delegate_(delegate.Pass()), |
| 56 state_(STATE_LOGIN_SCREEN), | 61 state_(STATE_LOGIN_SCREEN), |
| 57 util_(delegate_.get(), GetSupportedInputMethods()), | 62 util_(delegate_.get(), GetSupportedInputMethods()), |
| 58 component_extension_ime_manager_(new ComponentExtensionIMEManager()), | 63 component_extension_ime_manager_(new ComponentExtensionIMEManager()), |
| 59 weak_ptr_factory_(this) { | 64 weak_ptr_factory_(this) { |
| 60 } | 65 } |
| 61 | 66 |
| 62 InputMethodManagerImpl::~InputMethodManagerImpl() { | 67 InputMethodManagerImpl::~InputMethodManagerImpl() { |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 scoped_ptr<InputMethodDescriptors> input_methods(GetActiveInputMethods()); | 317 scoped_ptr<InputMethodDescriptors> input_methods(GetActiveInputMethods()); |
| 313 DCHECK(!input_methods->empty()); | 318 DCHECK(!input_methods->empty()); |
| 314 input_method_id_to_switch = input_methods->at(0).id(); | 319 input_method_id_to_switch = input_methods->at(0).id(); |
| 315 if (!input_method_id.empty()) { | 320 if (!input_method_id.empty()) { |
| 316 DVLOG(1) << "Can't change the current input method to " | 321 DVLOG(1) << "Can't change the current input method to " |
| 317 << input_method_id << " since the engine is not enabled. " | 322 << input_method_id << " since the engine is not enabled. " |
| 318 << "Switch to " << input_method_id_to_switch << " instead."; | 323 << "Switch to " << input_method_id_to_switch << " instead."; |
| 319 } | 324 } |
| 320 } | 325 } |
| 321 | 326 |
| 322 if (!component_extension_ime_manager_->IsInitialized() && | 327 if (!component_extension_ime_manager_->IsInitialized() && ( |
| 323 !InputMethodUtil::IsKeyboardLayout(input_method_id_to_switch)) { | 328 !InputMethodUtil::IsKeyboardLayout(input_method_id_to_switch) || |
| 329 extension_ime_util::IsKeyboardLayoutExtension( |
| 330 input_method_id_to_switch))) { |
| 324 // We can't change input method before the initialization of | 331 // We can't change input method before the initialization of |
| 325 // component extension ime manager. ChangeInputMethod will be | 332 // component extension ime manager. ChangeInputMethod will be |
| 326 // called with |pending_input_method_| when the initialization is | 333 // called with |pending_input_method_| when the initialization is |
| 327 // done. | 334 // done. |
| 328 pending_input_method_ = input_method_id_to_switch; | 335 pending_input_method_ = input_method_id_to_switch; |
| 329 return false; | 336 return false; |
| 330 } | 337 } |
| 331 pending_input_method_.clear(); | 338 pending_input_method_.clear(); |
| 332 | 339 |
| 333 // Hide candidate window and info list. | 340 // Hide candidate window and info list. |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 if (candidate_window_controller_.get()) | 842 if (candidate_window_controller_.get()) |
| 836 return; | 843 return; |
| 837 | 844 |
| 838 candidate_window_controller_.reset( | 845 candidate_window_controller_.reset( |
| 839 CandidateWindowController::CreateCandidateWindowController()); | 846 CandidateWindowController::CreateCandidateWindowController()); |
| 840 candidate_window_controller_->AddObserver(this); | 847 candidate_window_controller_->AddObserver(this); |
| 841 } | 848 } |
| 842 | 849 |
| 843 } // namespace input_method | 850 } // namespace input_method |
| 844 } // namespace chromeos | 851 } // namespace chromeos |
| OLD | NEW |