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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
422 bool InputMethodUtil::IsValidInputMethodId( | 422 bool InputMethodUtil::IsValidInputMethodId( |
423 const std::string& input_method_id) const { | 423 const std::string& input_method_id) const { |
424 // We can't check the component extension is whilelisted or not here because | 424 // We can't check the component extension is whilelisted or not here because |
425 // it might not be initialized. | 425 // it might not be initialized. |
426 return GetInputMethodDescriptorFromId(input_method_id) != NULL || | 426 return GetInputMethodDescriptorFromId(input_method_id) != NULL || |
427 extension_ime_util::IsComponentExtensionIME(input_method_id); | 427 extension_ime_util::IsComponentExtensionIME(input_method_id); |
428 } | 428 } |
429 | 429 |
430 // static | 430 // static |
431 bool InputMethodUtil::IsKeyboardLayout(const std::string& input_method_id) { | 431 bool InputMethodUtil::IsKeyboardLayout(const std::string& input_method_id) { |
432 return base::StartsWithASCII(input_method_id, "xkb:", false) || | 432 return base::StartsWith(input_method_id, "xkb:", |
Nico
2015/07/06 17:55:00
why was comparing with "xkb:" a case-sensitive com
| |
433 base::CompareCase::INSENSITIVE_ASCII) || | |
433 extension_ime_util::IsKeyboardLayoutExtension(input_method_id); | 434 extension_ime_util::IsKeyboardLayoutExtension(input_method_id); |
434 } | 435 } |
435 | 436 |
436 std::string InputMethodUtil::GetKeyboardLayoutName( | 437 std::string InputMethodUtil::GetKeyboardLayoutName( |
437 const std::string& input_method_id) const { | 438 const std::string& input_method_id) const { |
438 InputMethodIdToDescriptorMap::const_iterator iter | 439 InputMethodIdToDescriptorMap::const_iterator iter |
439 = id_to_descriptor_.find(input_method_id); | 440 = id_to_descriptor_.find(input_method_id); |
440 return (iter == id_to_descriptor_.end()) ? | 441 return (iter == id_to_descriptor_.end()) ? |
441 "" : iter->second.GetPreferredKeyboardLayout(); | 442 "" : iter->second.GetPreferredKeyboardLayout(); |
442 } | 443 } |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
788 "US", | 789 "US", |
789 layouts, | 790 layouts, |
790 languages, | 791 languages, |
791 true, // login keyboard. | 792 true, // login keyboard. |
792 GURL(), // options page, not available. | 793 GURL(), // options page, not available. |
793 GURL()); // input view page, not available. | 794 GURL()); // input view page, not available. |
794 } | 795 } |
795 | 796 |
796 } // namespace input_method | 797 } // namespace input_method |
797 } // namespace chromeos | 798 } // namespace chromeos |
OLD | NEW |