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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // TODO(yusukes): Some languages have two or more input methods. For example, | 374 // TODO(yusukes): Some languages have two or more input methods. For example, |
375 // Thai has 3, Vietnamese has 4. If these input methods could be activated at | 375 // Thai has 3, Vietnamese has 4. If these input methods could be activated at |
376 // the same time, we should do either of the following: | 376 // the same time, we should do either of the following: |
377 // (1) Add mappings to |kMappingFromIdToIndicatorText| | 377 // (1) Add mappings to |kMappingFromIdToIndicatorText| |
378 // (2) Add suffix (1, 2, ...) to |text| when ambiguous. | 378 // (2) Add suffix (1, 2, ...) to |text| when ambiguous. |
379 | 379 |
380 if (text.empty()) { | 380 if (text.empty()) { |
381 const size_t kMaxLanguageNameLen = 2; | 381 const size_t kMaxLanguageNameLen = 2; |
382 DCHECK(!input_method.language_codes().empty()); | 382 DCHECK(!input_method.language_codes().empty()); |
383 const std::string language_code = input_method.language_codes().at(0); | 383 const std::string language_code = input_method.language_codes().at(0); |
384 text = base::StringToUpperASCII(base::UTF8ToUTF16(language_code)).substr( | 384 text = StringToUpperASCII(base::UTF8ToUTF16(language_code)).substr( |
385 0, kMaxLanguageNameLen); | 385 0, kMaxLanguageNameLen); |
386 } | 386 } |
387 DCHECK(!text.empty()) << input_method.id(); | 387 DCHECK(!text.empty()) << input_method.id(); |
388 return text; | 388 return text; |
389 } | 389 } |
390 | 390 |
391 base::string16 InputMethodUtil::GetInputMethodMediumName( | 391 base::string16 InputMethodUtil::GetInputMethodMediumName( |
392 const InputMethodDescriptor& input_method) const { | 392 const InputMethodDescriptor& input_method) const { |
393 // For the "Your input method has changed to..." bubble. In most cases | 393 // For the "Your input method has changed to..." bubble. In most cases |
394 // it uses the same name as the short name, unless found in a table | 394 // it uses the same name as the short name, unless found in a table |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 "US", | 721 "US", |
722 layouts, | 722 layouts, |
723 languages, | 723 languages, |
724 true, // login keyboard. | 724 true, // login keyboard. |
725 GURL(), // options page, not available. | 725 GURL(), // options page, not available. |
726 GURL()); // input view page, not available. | 726 GURL()); // input view page, not available. |
727 } | 727 } |
728 | 728 |
729 } // namespace input_method | 729 } // namespace input_method |
730 } // namespace chromeos | 730 } // namespace chromeos |
OLD | NEW |