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 "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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 341 if (!pending_input_method_.empty()) { | 341 if (!pending_input_method_.empty()) { |
| 342 ChangeInputMethod(pending_input_method_); | 342 ChangeInputMethod(pending_input_method_); |
| 343 pending_input_method_.clear(); | 343 pending_input_method_.clear(); |
| 344 } | 344 } |
| 345 | 345 |
| 346 } | 346 } |
| 347 | 347 |
| 348 void InputMethodManagerImpl::LoadNecessaryComponentExtensions() { | 348 void InputMethodManagerImpl::LoadNecessaryComponentExtensions() { |
| 349 if (!component_extension_ime_manager_->IsInitialized()) | 349 if (!component_extension_ime_manager_->IsInitialized()) |
| 350 return; | 350 return; |
| 351 for (size_t i = 0; i < active_input_method_ids_.size(); ++i) { | 351 // We have to do sanity check here, because some component extension IMEs may |
|
satorux1
2013/04/15 08:31:32
sanity check may be unclear. What about:
Load com
Seigo Nonaka
2013/04/16 07:17:03
Sure thanks! Done.
| |
| 352 if (component_extension_ime_manager_->IsWhitelisted( | 352 // be removed. So if specified component extension IME is no longer existing, |
|
satorux1
2013/04/15 08:31:32
may be removed -> might have been removed from the
Seigo Nonaka
2013/04/16 07:17:03
Done.
| |
| 353 active_input_method_ids_[i])) { | 353 // falling back to existing IME. |
|
satorux1
2013/04/15 08:31:32
fall back to an existing IME.
Seigo Nonaka
2013/04/16 07:17:03
Done.
| |
| 354 std::vector<std::string> unfiltered_input_method_ids = | |
| 355 active_input_method_ids_; | |
| 356 active_input_method_ids_.clear(); | |
| 357 for (size_t i = 0; i < unfiltered_input_method_ids.size(); ++i) { | |
| 358 if (!component_extension_ime_manager_->IsComponentExtensionIMEId( | |
| 359 unfiltered_input_method_ids[i])) { | |
| 360 // Legacy IMEs or xkb layouts are active alwayes. | |
|
satorux1
2013/04/15 08:31:32
always active
Seigo Nonaka
2013/04/16 07:17:03
Done.
| |
| 361 active_input_method_ids_.push_back(unfiltered_input_method_ids[i]); | |
| 362 } else if (component_extension_ime_manager_->IsWhitelisted( | |
| 363 unfiltered_input_method_ids[i])) { | |
| 354 component_extension_ime_manager_->LoadComponentExtensionIME( | 364 component_extension_ime_manager_->LoadComponentExtensionIME( |
| 355 active_input_method_ids_[i]); | 365 unfiltered_input_method_ids[i]); |
| 366 active_input_method_ids_.push_back(unfiltered_input_method_ids[i]); | |
| 356 } | 367 } |
| 357 } | 368 } |
| 358 } | 369 } |
| 359 | 370 |
| 360 void InputMethodManagerImpl::ActivateInputMethodProperty( | 371 void InputMethodManagerImpl::ActivateInputMethodProperty( |
| 361 const std::string& key) { | 372 const std::string& key) { |
| 362 DCHECK(!key.empty()); | 373 DCHECK(!key.empty()); |
| 363 ibus_controller_->ActivateInputMethodProperty(key); | 374 ibus_controller_->ActivateInputMethodProperty(key); |
| 364 } | 375 } |
| 365 | 376 |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 780 candidate_window_controller_.reset( | 791 candidate_window_controller_.reset( |
| 781 CandidateWindowController::CreateCandidateWindowController()); | 792 CandidateWindowController::CreateCandidateWindowController()); |
| 782 if (candidate_window_controller_->Init(ibus_controller_.get())) | 793 if (candidate_window_controller_->Init(ibus_controller_.get())) |
| 783 candidate_window_controller_->AddObserver(this); | 794 candidate_window_controller_->AddObserver(this); |
| 784 else | 795 else |
| 785 DVLOG(1) << "Failed to initialize the candidate window controller"; | 796 DVLOG(1) << "Failed to initialize the candidate window controller"; |
| 786 } | 797 } |
| 787 | 798 |
| 788 } // namespace input_method | 799 } // namespace input_method |
| 789 } // namespace chromeos | 800 } // namespace chromeos |
| OLD | NEW |