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