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

Side by Side Diff: app/l10n_util.cc

Issue 194060: Add a "ToUpper" method (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « app/l10n_util.h ('k') | app/l10n_util_unittest.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "app/l10n_util.h" 5 #include "app/l10n_util.h"
6 6
7 #include "app/app_paths.h" 7 #include "app/app_paths.h"
8 #include "app/app_switches.h" 8 #include "app/app_switches.h"
9 #include "app/gfx/canvas.h" 9 #include "app/gfx/canvas.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 640
641 string16 ToLower(const string16& string) { 641 string16 ToLower(const string16& string) {
642 icu::UnicodeString lower_u_str( 642 icu::UnicodeString lower_u_str(
643 icu::UnicodeString(string.c_str()).toLower(icu::Locale::getDefault())); 643 icu::UnicodeString(string.c_str()).toLower(icu::Locale::getDefault()));
644 string16 result; 644 string16 result;
645 lower_u_str.extract(0, lower_u_str.length(), 645 lower_u_str.extract(0, lower_u_str.length(),
646 WriteInto(&result, lower_u_str.length() + 1)); 646 WriteInto(&result, lower_u_str.length() + 1));
647 return result; 647 return result;
648 } 648 }
649 649
650 string16 ToUpper(const string16& string) {
651 icu::UnicodeString upper_u_str(
652 icu::UnicodeString(string.c_str()).toUpper(icu::Locale::getDefault()));
653 string16 result;
654 upper_u_str.extract(0, upper_u_str.length(),
655 WriteInto(&result, upper_u_str.length() + 1));
656 return result;
657 }
658
650 // Returns the text direction for the default ICU locale. It is assumed 659 // Returns the text direction for the default ICU locale. It is assumed
651 // that SetICUDefaultLocale has been called to set the default locale to 660 // that SetICUDefaultLocale has been called to set the default locale to
652 // the UI locale of Chrome. 661 // the UI locale of Chrome.
653 TextDirection GetTextDirection() { 662 TextDirection GetTextDirection() {
654 if (g_text_direction == UNKNOWN_DIRECTION) { 663 if (g_text_direction == UNKNOWN_DIRECTION) {
655 #if defined(TOOLKIT_GTK) 664 #if defined(TOOLKIT_GTK)
656 GtkTextDirection gtk_dir = gtk_widget_get_default_direction(); 665 GtkTextDirection gtk_dir = gtk_widget_get_default_direction();
657 g_text_direction = 666 g_text_direction =
658 (gtk_dir == GTK_TEXT_DIR_LTR) ? LEFT_TO_RIGHT : RIGHT_TO_LEFT; 667 (gtk_dir == GTK_TEXT_DIR_LTR) ? LEFT_TO_RIGHT : RIGHT_TO_LEFT;
659 #else 668 #else
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 } 947 }
939 948
940 void BiDiLineIterator::GetLogicalRun(int start, 949 void BiDiLineIterator::GetLogicalRun(int start,
941 int* end, 950 int* end,
942 UBiDiLevel* level) { 951 UBiDiLevel* level) {
943 DCHECK(bidi_ != NULL); 952 DCHECK(bidi_ != NULL);
944 ubidi_getLogicalRun(bidi_, start, end, level); 953 ubidi_getLogicalRun(bidi_, start, end, level);
945 } 954 }
946 955
947 } 956 }
OLDNEW
« no previous file with comments | « app/l10n_util.h ('k') | app/l10n_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698