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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 if (ix != extra_input_methods_.end()) | 123 if (ix != extra_input_methods_.end()) |
124 result->push_back(ix->second); | 124 result->push_back(ix->second); |
125 else | 125 else |
126 DVLOG(1) << "Descriptor is not found for: " << input_method_id; | 126 DVLOG(1) << "Descriptor is not found for: " << input_method_id; |
127 } | 127 } |
128 } | 128 } |
129 if (result->empty()) { | 129 if (result->empty()) { |
130 // Initially |active_input_method_ids_| is empty. browser_tests might take | 130 // Initially |active_input_method_ids_| is empty. browser_tests might take |
131 // this path. | 131 // this path. |
132 result->push_back( | 132 result->push_back( |
133 InputMethodDescriptor::GetFallbackInputMethodDescriptor()); | 133 InputMethodUtil::GetFallbackInputMethodDescriptor()); |
134 } | 134 } |
135 return result.Pass(); | 135 return result.Pass(); |
136 } | 136 } |
137 | 137 |
138 size_t InputMethodManagerImpl::GetNumActiveInputMethods() const { | 138 size_t InputMethodManagerImpl::GetNumActiveInputMethods() const { |
139 return active_input_method_ids_.size(); | 139 return active_input_method_ids_.size(); |
140 } | 140 } |
141 | 141 |
142 void InputMethodManagerImpl::EnableLayouts(const std::string& language_code, | 142 void InputMethodManagerImpl::EnableLayouts(const std::string& language_code, |
143 const std::string& initial_layout) { | 143 const std::string& initial_layout) { |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 current_input_method_id); | 605 current_input_method_id); |
606 if (iter != input_method_ids.end()) | 606 if (iter != input_method_ids.end()) |
607 ++iter; | 607 ++iter; |
608 if (iter == input_method_ids.end()) | 608 if (iter == input_method_ids.end()) |
609 iter = input_method_ids.begin(); | 609 iter = input_method_ids.begin(); |
610 ChangeInputMethodInternal(*iter, true); | 610 ChangeInputMethodInternal(*iter, true); |
611 } | 611 } |
612 | 612 |
613 InputMethodDescriptor InputMethodManagerImpl::GetCurrentInputMethod() const { | 613 InputMethodDescriptor InputMethodManagerImpl::GetCurrentInputMethod() const { |
614 if (current_input_method_.id().empty()) | 614 if (current_input_method_.id().empty()) |
615 return InputMethodDescriptor::GetFallbackInputMethodDescriptor(); | 615 return InputMethodUtil::GetFallbackInputMethodDescriptor(); |
616 return current_input_method_; | 616 return current_input_method_; |
617 } | 617 } |
618 | 618 |
619 InputMethodPropertyList | 619 InputMethodPropertyList |
620 InputMethodManagerImpl::GetCurrentInputMethodProperties() const { | 620 InputMethodManagerImpl::GetCurrentInputMethodProperties() const { |
621 // This check is necessary since an IME property (e.g. for Pinyin) might be | 621 // This check is necessary since an IME property (e.g. for Pinyin) might be |
622 // sent from ibus-daemon AFTER the current input method is switched to XKB. | 622 // sent from ibus-daemon AFTER the current input method is switched to XKB. |
623 if (InputMethodUtil::IsKeyboardLayout(GetCurrentInputMethod().id())) | 623 if (InputMethodUtil::IsKeyboardLayout(GetCurrentInputMethod().id())) |
624 return InputMethodPropertyList(); | 624 return InputMethodPropertyList(); |
625 return ibus_controller_->GetCurrentProperties(); | 625 return ibus_controller_->GetCurrentProperties(); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 candidate_window_controller_.reset( | 794 candidate_window_controller_.reset( |
795 CandidateWindowController::CreateCandidateWindowController()); | 795 CandidateWindowController::CreateCandidateWindowController()); |
796 if (candidate_window_controller_->Init(ibus_controller_.get())) | 796 if (candidate_window_controller_->Init(ibus_controller_.get())) |
797 candidate_window_controller_->AddObserver(this); | 797 candidate_window_controller_->AddObserver(this); |
798 else | 798 else |
799 DVLOG(1) << "Failed to initialize the candidate window controller"; | 799 DVLOG(1) << "Failed to initialize the candidate window controller"; |
800 } | 800 } |
801 | 801 |
802 } // namespace input_method | 802 } // namespace input_method |
803 } // namespace chromeos | 803 } // namespace chromeos |
OLD | NEW |