Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1396)

Side by Side Diff: ui/base/ime/chromeos/input_method_descriptor.cc

Issue 1280473002: Update ToLower/UpperASCII API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « storage/common/fileapi/file_system_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/base/ime/chromeos/input_method_descriptor.h" 5 #include "ui/base/ime/chromeos/input_method_descriptor.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 27 matching lines...) Expand all
38 // TODO(nona): Investigate better way to guess the preferred layout 38 // TODO(nona): Investigate better way to guess the preferred layout
39 // http://crbug.com/170601. 39 // http://crbug.com/170601.
40 return keyboard_layouts_.empty() ? "us" : keyboard_layouts_[0]; 40 return keyboard_layouts_.empty() ? "us" : keyboard_layouts_[0];
41 } 41 }
42 42
43 std::string InputMethodDescriptor::GetIndicator() const { 43 std::string InputMethodDescriptor::GetIndicator() const {
44 // If indicator is empty, use the first two character in its preferred 44 // If indicator is empty, use the first two character in its preferred
45 // keyboard layout or language code. 45 // keyboard layout or language code.
46 if (indicator_.empty()) { 46 if (indicator_.empty()) {
47 if (extension_ime_util::IsKeyboardLayoutExtension(id_)) { 47 if (extension_ime_util::IsKeyboardLayoutExtension(id_)) {
48 return base::StringToUpperASCII( 48 return base::ToUpperASCII(GetPreferredKeyboardLayout().substr(0, 2));
49 GetPreferredKeyboardLayout().substr(0, 2));
50 } 49 }
51 DCHECK(language_codes_.size() > 0); 50 DCHECK(language_codes_.size() > 0);
52 return base::StringToUpperASCII(language_codes_[0].substr(0, 2)); 51 return base::ToUpperASCII(language_codes_[0].substr(0, 2));
53 } 52 }
54 return indicator_; 53 return indicator_;
55 } 54 }
56 55
57 InputMethodDescriptor::InputMethodDescriptor() { 56 InputMethodDescriptor::InputMethodDescriptor() {
58 } 57 }
59 58
60 InputMethodDescriptor::~InputMethodDescriptor() { 59 InputMethodDescriptor::~InputMethodDescriptor() {
61 } 60 }
62 61
63 } // namespace input_method 62 } // namespace input_method
64 } // namespace chromeos 63 } // namespace chromeos
OLDNEW
« no previous file with comments | « storage/common/fileapi/file_system_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698