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_util.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 id_to_descriptor_.insert( | 655 id_to_descriptor_.insert( |
656 std::make_pair(input_method.id(), input_method)); | 656 std::make_pair(input_method.id(), input_method)); |
657 } | 657 } |
658 } | 658 } |
659 | 659 |
660 InputMethodDescriptor InputMethodUtil::GetFallbackInputMethodDescriptor() { | 660 InputMethodDescriptor InputMethodUtil::GetFallbackInputMethodDescriptor() { |
661 return InputMethodDescriptor("xkb:us::eng", | 661 return InputMethodDescriptor("xkb:us::eng", |
662 "", | 662 "", |
663 "us", | 663 "us", |
664 "en-US", | 664 "en-US", |
665 "", // options page, not available. | 665 ""); // options page, not available. |
666 false); | |
667 } | 666 } |
668 | 667 |
669 void InputMethodUtil::ReloadInternalMaps() { | 668 void InputMethodUtil::ReloadInternalMaps() { |
670 if (supported_input_methods_->size() <= 1) { | 669 if (supported_input_methods_->size() <= 1) { |
671 DVLOG(1) << "GetSupportedInputMethods returned a fallback ID"; | 670 DVLOG(1) << "GetSupportedInputMethods returned a fallback ID"; |
672 // TODO(yusukes): Handle this error in nicer way. | 671 // TODO(yusukes): Handle this error in nicer way. |
673 } | 672 } |
674 | 673 |
675 // Clear the existing maps. | 674 // Clear the existing maps. |
676 language_code_to_ids_.clear(); | 675 language_code_to_ids_.clear(); |
(...skipping 29 matching lines...) Expand all Loading... |
706 if (iter != id_to_descriptor_.end()) { | 705 if (iter != id_to_descriptor_.end()) { |
707 const InputMethodDescriptor& input_method = iter->second; | 706 const InputMethodDescriptor& input_method = iter->second; |
708 language_code_to_ids_.insert( | 707 language_code_to_ids_.insert( |
709 std::make_pair(language_code, input_method.id())); | 708 std::make_pair(language_code, input_method.id())); |
710 } | 709 } |
711 } | 710 } |
712 } | 711 } |
713 | 712 |
714 } // namespace input_method | 713 } // namespace input_method |
715 } // namespace chromeos | 714 } // namespace chromeos |
OLD | NEW |