| 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 InputMethodUtil::~InputMethodUtil() { | 371 InputMethodUtil::~InputMethodUtil() { |
| 372 } | 372 } |
| 373 | 373 |
| 374 std::string InputMethodUtil::GetLocalizedDisplayName( | 374 std::string InputMethodUtil::GetLocalizedDisplayName( |
| 375 const InputMethodDescriptor& descriptor) const { | 375 const InputMethodDescriptor& descriptor) const { |
| 376 // Localizes the input method name. | 376 // Localizes the input method name. |
| 377 const std::string& disp = descriptor.name(); | 377 const std::string& disp = descriptor.name(); |
| 378 if (disp.find("__MSG_") == 0) { | 378 if (disp.find("__MSG_") == 0) { |
| 379 const InputMethodNameMap* map = kInputMethodNameMap; | 379 const InputMethodNameMap* map = kInputMethodNameMap; |
| 380 size_t map_size = arraysize(kInputMethodNameMap); | 380 size_t map_size = arraysize(kInputMethodNameMap); |
| 381 std::string name = StringToUpperASCII(disp); | 381 std::string name = base::StringToUpperASCII(disp); |
| 382 const InputMethodNameMap map_key = {name.c_str(), 0}; | 382 const InputMethodNameMap map_key = {name.c_str(), 0}; |
| 383 const InputMethodNameMap* p = | 383 const InputMethodNameMap* p = |
| 384 std::lower_bound(map, map + map_size, map_key); | 384 std::lower_bound(map, map + map_size, map_key); |
| 385 if (p != map + map_size && name == p->message_name) | 385 if (p != map + map_size && name == p->message_name) |
| 386 return l10n_util::GetStringUTF8(p->resource_id); | 386 return l10n_util::GetStringUTF8(p->resource_id); |
| 387 } | 387 } |
| 388 return disp; | 388 return disp; |
| 389 } | 389 } |
| 390 | 390 |
| 391 bool InputMethodUtil::TranslateStringInternal( | 391 bool InputMethodUtil::TranslateStringInternal( |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 "US", | 786 "US", |
| 787 layouts, | 787 layouts, |
| 788 languages, | 788 languages, |
| 789 true, // login keyboard. | 789 true, // login keyboard. |
| 790 GURL(), // options page, not available. | 790 GURL(), // options page, not available. |
| 791 GURL()); // input view page, not available. | 791 GURL()); // input view page, not available. |
| 792 } | 792 } |
| 793 | 793 |
| 794 } // namespace input_method | 794 } // namespace input_method |
| 795 } // namespace chromeos | 795 } // namespace chromeos |
| OLD | NEW |