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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 InputMethodChanged(this, show_message)); | 400 InputMethodChanged(this, show_message)); |
401 return true; | 401 return true; |
402 } | 402 } |
403 | 403 |
404 bool InputMethodManagerImpl::IsXkbComponentExtensionAvailable() const { | 404 bool InputMethodManagerImpl::IsXkbComponentExtensionAvailable() const { |
405 if (!component_extension_ime_manager_->IsInitialized()) | 405 if (!component_extension_ime_manager_->IsInitialized()) |
406 return false; | 406 return false; |
407 InputMethodDescriptors imes = | 407 InputMethodDescriptors imes = |
408 component_extension_ime_manager_->GetAllIMEAsInputMethodDescriptor(); | 408 component_extension_ime_manager_->GetAllIMEAsInputMethodDescriptor(); |
409 for (size_t i = 0; i < imes.size(); ++i) { | 409 for (size_t i = 0; i < imes.size(); ++i) { |
410 if (StartsWithASCII(imes[i].id(), "xkb:", true)) | 410 if (StartsWithASCII(extension_ime_util::MaybeGetLegacyXkbId( |
| 411 imes[i].id()), "xkb:", true)) |
411 return true; | 412 return true; |
412 } | 413 } |
413 return false; | 414 return false; |
414 } | 415 } |
415 | 416 |
416 void InputMethodManagerImpl::OnComponentExtensionInitialized( | 417 void InputMethodManagerImpl::OnComponentExtensionInitialized( |
417 scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate) { | 418 scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate) { |
418 DCHECK(thread_checker_.CalledOnValidThread()); | 419 DCHECK(thread_checker_.CalledOnValidThread()); |
419 component_extension_ime_manager_->Initialize(delegate.Pass()); | 420 component_extension_ime_manager_->Initialize(delegate.Pass()); |
420 InputMethodDescriptors imes = | 421 InputMethodDescriptors imes = |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 CandidateWindowController::CreateCandidateWindowController()); | 869 CandidateWindowController::CreateCandidateWindowController()); |
869 candidate_window_controller_->AddObserver(this); | 870 candidate_window_controller_->AddObserver(this); |
870 } | 871 } |
871 | 872 |
872 Profile* InputMethodManagerImpl::GetProfile() const { | 873 Profile* InputMethodManagerImpl::GetProfile() const { |
873 return ProfileManager::GetActiveUserProfile(); | 874 return ProfileManager::GetActiveUserProfile(); |
874 } | 875 } |
875 | 876 |
876 } // namespace input_method | 877 } // namespace input_method |
877 } // namespace chromeos | 878 } // namespace chromeos |
OLD | NEW |