| 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 } | 675 } |
| 676 ids.swap(new_ids); | 676 ids.swap(new_ids); |
| 677 } | 677 } |
| 678 return rewritten; | 678 return rewritten; |
| 679 } | 679 } |
| 680 | 680 |
| 681 void InputMethodUtil::UpdateHardwareLayoutCache() { | 681 void InputMethodUtil::UpdateHardwareLayoutCache() { |
| 682 DCHECK(thread_checker_.CalledOnValidThread()); | 682 DCHECK(thread_checker_.CalledOnValidThread()); |
| 683 hardware_layouts_.clear(); | 683 hardware_layouts_.clear(); |
| 684 hardware_login_layouts_.clear(); | 684 hardware_login_layouts_.clear(); |
| 685 if (cached_hardware_layouts_.empty()) | 685 if (cached_hardware_layouts_.empty()) { |
| 686 Tokenize(delegate_->GetHardwareKeyboardLayouts(), ",", | 686 cached_hardware_layouts_ = |
| 687 &cached_hardware_layouts_); | 687 base::SplitString(delegate_->GetHardwareKeyboardLayouts(), ",", |
| 688 base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); |
| 689 } |
| 688 hardware_layouts_ = cached_hardware_layouts_; | 690 hardware_layouts_ = cached_hardware_layouts_; |
| 689 MigrateInputMethods(&hardware_layouts_); | 691 MigrateInputMethods(&hardware_layouts_); |
| 690 | 692 |
| 691 for (size_t i = 0; i < hardware_layouts_.size(); ++i) { | 693 for (size_t i = 0; i < hardware_layouts_.size(); ++i) { |
| 692 if (IsLoginKeyboard(hardware_layouts_[i])) | 694 if (IsLoginKeyboard(hardware_layouts_[i])) |
| 693 hardware_login_layouts_.push_back(hardware_layouts_[i]); | 695 hardware_login_layouts_.push_back(hardware_layouts_[i]); |
| 694 } | 696 } |
| 695 | 697 |
| 696 if (hardware_login_layouts_.empty()) { | 698 if (hardware_login_layouts_.empty()) { |
| 697 // This is totally fine if |hardware_layouts_| is empty. The hardware | 699 // This is totally fine if |hardware_layouts_| is empty. The hardware |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 "US", | 788 "US", |
| 787 layouts, | 789 layouts, |
| 788 languages, | 790 languages, |
| 789 true, // login keyboard. | 791 true, // login keyboard. |
| 790 GURL(), // options page, not available. | 792 GURL(), // options page, not available. |
| 791 GURL()); // input view page, not available. | 793 GURL()); // input view page, not available. |
| 792 } | 794 } |
| 793 | 795 |
| 794 } // namespace input_method | 796 } // namespace input_method |
| 795 } // namespace chromeos | 797 } // namespace chromeos |
| OLD | NEW |