| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 }; | 238 }; |
| 239 const size_t kEnglishToResourceIdArraySize = | 239 const size_t kEnglishToResourceIdArraySize = |
| 240 arraysize(kEnglishToResourceIdArray); | 240 arraysize(kEnglishToResourceIdArray); |
| 241 | 241 |
| 242 } // namespace | 242 } // namespace |
| 243 | 243 |
| 244 namespace chromeos { | 244 namespace chromeos { |
| 245 | 245 |
| 246 namespace input_method { | 246 namespace input_method { |
| 247 | 247 |
| 248 InputMethodUtil::InputMethodUtil( | 248 InputMethodUtil::InputMethodUtil(InputMethodDelegate* delegate) |
| 249 InputMethodDelegate* delegate, | |
| 250 scoped_ptr<InputMethodDescriptors> supported_input_methods) | |
| 251 : delegate_(delegate) { | 249 : delegate_(delegate) { |
| 252 // Makes sure the supported input methods at least have the fallback ime. | 250 InputMethodDescriptors default_input_methods; |
| 253 // So that it won't cause massive test failures. | 251 default_input_methods.push_back(GetFallbackInputMethodDescriptor()); |
| 254 if (supported_input_methods->empty()) | 252 ResetInputMethods(default_input_methods); |
| 255 supported_input_methods->push_back(GetFallbackInputMethodDescriptor()); | |
| 256 | |
| 257 ResetInputMethods(*supported_input_methods); | |
| 258 | 253 |
| 259 // Initialize a map from English string to Chrome string resource ID as well. | 254 // Initialize a map from English string to Chrome string resource ID as well. |
| 260 for (size_t i = 0; i < kEnglishToResourceIdArraySize; ++i) { | 255 for (size_t i = 0; i < kEnglishToResourceIdArraySize; ++i) { |
| 261 const EnglishToResouceId& map_entry = kEnglishToResourceIdArray[i]; | 256 const EnglishToResouceId& map_entry = kEnglishToResourceIdArray[i]; |
| 262 const bool result = english_to_resource_id_.insert(std::make_pair( | 257 const bool result = english_to_resource_id_.insert(std::make_pair( |
| 263 map_entry.english_string_from_ibus, map_entry.resource_id)).second; | 258 map_entry.english_string_from_ibus, map_entry.resource_id)).second; |
| 264 DCHECK(result) << "Duplicated string is found: " | 259 DCHECK(result) << "Duplicated string is found: " |
| 265 << map_entry.english_string_from_ibus; | 260 << map_entry.english_string_from_ibus; |
| 266 } | 261 } |
| 267 | 262 |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 "US", | 703 "US", |
| 709 layouts, | 704 layouts, |
| 710 languages, | 705 languages, |
| 711 true, // login keyboard. | 706 true, // login keyboard. |
| 712 GURL(), // options page, not available. | 707 GURL(), // options page, not available. |
| 713 GURL()); // input view page, not available. | 708 GURL()); // input view page, not available. |
| 714 } | 709 } |
| 715 | 710 |
| 716 } // namespace input_method | 711 } // namespace input_method |
| 717 } // namespace chromeos | 712 } // namespace chromeos |
| OLD | NEW |