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

Side by Side Diff: chrome/browser/chromeos/status/input_method_menu.cc

Issue 3750001: base: Move SplitString functions into the base namespace and update the callers. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: brett review, reverted changes in o3d due to it's using an old base revision Created 10 years, 2 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 | « chrome/browser/chromeos/preferences.cc ('k') | chrome/browser/chromeos/version_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/status/input_method_menu.h" 5 #include "chrome/browser/chromeos/status/input_method_menu.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include <gtk/gtk.h> // for gtk_menu_shell_set_take_focus. 9 #include <gtk/gtk.h> // for gtk_menu_shell_set_take_focus.
10 10
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 563
564 if (text.empty()) { 564 if (text.empty()) {
565 const size_t kMaxLanguageNameLen = 2; 565 const size_t kMaxLanguageNameLen = 2;
566 std::string language_code = 566 std::string language_code =
567 input_method::GetLanguageCodeFromDescriptor(input_method); 567 input_method::GetLanguageCodeFromDescriptor(input_method);
568 568
569 // Use "CN" for simplified Chinese and "TW" for traditonal Chinese, 569 // Use "CN" for simplified Chinese and "TW" for traditonal Chinese,
570 // rather than "ZH". 570 // rather than "ZH".
571 if (StartsWithASCII(language_code, "zh-", false)) { 571 if (StartsWithASCII(language_code, "zh-", false)) {
572 std::vector<std::string> portions; 572 std::vector<std::string> portions;
573 SplitString(language_code, '-', &portions); 573 base::SplitString(language_code, '-', &portions);
574 if (portions.size() >= 2 && !portions[1].empty()) { 574 if (portions.size() >= 2 && !portions[1].empty()) {
575 language_code = portions[1]; 575 language_code = portions[1];
576 } 576 }
577 } 577 }
578 578
579 text = StringToUpperASCII(UTF8ToWide(language_code)).substr( 579 text = StringToUpperASCII(UTF8ToWide(language_code)).substr(
580 0, kMaxLanguageNameLen); 580 0, kMaxLanguageNameLen);
581 } 581 }
582 DCHECK(!text.empty()); 582 DCHECK(!text.empty());
583 return text; 583 return text;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 logged_in_ = true; 619 logged_in_ = true;
620 } 620 }
621 } 621 }
622 622
623 void InputMethodMenu::SetMinimumWidth(int width) { 623 void InputMethodMenu::SetMinimumWidth(int width) {
624 // On the OOBE network selection screen, fixed width menu would be preferable. 624 // On the OOBE network selection screen, fixed width menu would be preferable.
625 minimum_language_menu_width_ = width; 625 minimum_language_menu_width_ = width;
626 } 626 }
627 627
628 } // namespace chromeos 628 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/preferences.cc ('k') | chrome/browser/chromeos/version_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698