| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "unicode/uloc.h" |
| 12 |
| 11 #include "app/l10n_util.h" | 13 #include "app/l10n_util.h" |
| 12 #include "app/l10n_util_collator.h" | 14 #include "app/l10n_util_collator.h" |
| 13 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 14 #include "base/hash_tables.h" | 16 #include "base/hash_tables.h" |
| 15 #include "base/scoped_ptr.h" | 17 #include "base/scoped_ptr.h" |
| 16 #include "base/singleton.h" | 18 #include "base/singleton.h" |
| 17 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 18 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
| 19 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/chrome_thread.h" | 22 #include "chrome/browser/chrome_thread.h" |
| 21 #include "chrome/browser/chromeos/cros/cros_library.h" | 23 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 22 #include "chrome/browser/chromeos/cros/keyboard_library.h" | 24 #include "chrome/browser/chromeos/cros/keyboard_library.h" |
| 23 #include "chrome/browser/chromeos/language_preferences.h" | 25 #include "chrome/browser/chromeos/language_preferences.h" |
| 24 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
| 25 #include "third_party/icu/public/common/unicode/uloc.h" | |
| 26 | 27 |
| 27 namespace { | 28 namespace { |
| 28 | 29 |
| 29 // Map from language code to associated input method IDs, etc. | 30 // Map from language code to associated input method IDs, etc. |
| 30 typedef std::multimap<std::string, std::string> LanguageCodeToIdsMap; | 31 typedef std::multimap<std::string, std::string> LanguageCodeToIdsMap; |
| 31 struct IdMaps { | 32 struct IdMaps { |
| 32 scoped_ptr<LanguageCodeToIdsMap> language_code_to_ids; | 33 scoped_ptr<LanguageCodeToIdsMap> language_code_to_ids; |
| 33 scoped_ptr<std::map<std::string, std::string> > id_to_language_code; | 34 scoped_ptr<std::map<std::string, std::string> > id_to_language_code; |
| 34 scoped_ptr<std::map<std::string, std::string> > id_to_display_name; | 35 scoped_ptr<std::map<std::string, std::string> > id_to_display_name; |
| 35 | 36 |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 value.string_list_value = input_method_ids; | 573 value.string_list_value = input_method_ids; |
| 573 InputMethodLibrary* library = CrosLibrary::Get()->GetInputMethodLibrary(); | 574 InputMethodLibrary* library = CrosLibrary::Get()->GetInputMethodLibrary(); |
| 574 library->SetImeConfig(kGeneralSectionName, kPreloadEnginesConfigName, value); | 575 library->SetImeConfig(kGeneralSectionName, kPreloadEnginesConfigName, value); |
| 575 if (!initial_input_method_id.empty()) { | 576 if (!initial_input_method_id.empty()) { |
| 576 library->ChangeInputMethod(initial_input_method_id); | 577 library->ChangeInputMethod(initial_input_method_id); |
| 577 } | 578 } |
| 578 } | 579 } |
| 579 | 580 |
| 580 } // namespace input_method | 581 } // namespace input_method |
| 581 } // namespace chromeos | 582 } // namespace chromeos |
| OLD | NEW |