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

Side by Side Diff: base/i18n/rtl.h

Issue 6878089: Add and use a base::i18n::StringWithDirection for carrying titles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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
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 #ifndef BASE_I18N_RTL_H_ 5 #ifndef BASE_I18N_RTL_H_
6 #define BASE_I18N_RTL_H_ 6 #define BASE_I18N_RTL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 13 matching lines...) Expand all
24 const char16 kPopDirectionalFormatting = 0x202C; 24 const char16 kPopDirectionalFormatting = 0x202C;
25 const char16 kLeftToRightOverride = 0x202D; 25 const char16 kLeftToRightOverride = 0x202D;
26 const char16 kRightToLeftOverride = 0x202E; 26 const char16 kRightToLeftOverride = 0x202E;
27 27
28 enum TextDirection { 28 enum TextDirection {
29 UNKNOWN_DIRECTION, 29 UNKNOWN_DIRECTION,
30 RIGHT_TO_LEFT, 30 RIGHT_TO_LEFT,
31 LEFT_TO_RIGHT, 31 LEFT_TO_RIGHT,
32 }; 32 };
33 33
34 // A string along with the text direction it should be displayed in.
35 // Conceptually this is a struct; we just use 'class' to make it easier for
36 // others to forward-declare us with 'class StringWithDirection'.
37 class StringWithDirection {
darin (slow to review) 2011/04/21 02:56:00 String16WithDirection maybe? see NullableString16
38 public:
39 StringWithDirection() : direction(UNKNOWN_DIRECTION) { }
40 StringWithDirection(const string16& str, TextDirection dir)
41 : string(str), direction(dir) { }
42
43 string16 string;
darin (slow to review) 2011/04/21 02:56:00 do you need to mutate these later? how about just
44 TextDirection direction;
45 };
46
34 // Get the locale that the currently running process has been configured to use. 47 // Get the locale that the currently running process has been configured to use.
35 // The return value is of the form language[-country] (e.g., en-US) where the 48 // The return value is of the form language[-country] (e.g., en-US) where the
36 // language is the 2 or 3 letter code from ISO-639. 49 // language is the 2 or 3 letter code from ISO-639.
37 std::string GetConfiguredLocale(); 50 std::string GetConfiguredLocale();
38 51
39 // Canonicalize a string (eg. a POSIX locale string) to a Chrome locale name. 52 // Canonicalize a string (eg. a POSIX locale string) to a Chrome locale name.
40 std::string GetCanonicalLocale(const char* locale); 53 std::string GetCanonicalLocale(const char* locale);
41 54
42 // Sets the default locale of ICU. 55 // Sets the default locale of ICU.
43 // Once the application locale of Chrome in GetApplicationLocale is determined, 56 // Once the application locale of Chrome in GetApplicationLocale is determined,
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // return the text itself. Explicit bidi control characters display and have 153 // return the text itself. Explicit bidi control characters display and have
141 // semantic effect. They can be deleted so they might not always appear in a 154 // semantic effect. They can be deleted so they might not always appear in a
142 // pair. 155 // pair.
143 const string16 StripWrappingBidiControlCharacters(const string16& text) 156 const string16 StripWrappingBidiControlCharacters(const string16& text)
144 WARN_UNUSED_RESULT; 157 WARN_UNUSED_RESULT;
145 158
146 } // namespace i18n 159 } // namespace i18n
147 } // namespace base 160 } // namespace base
148 161
149 #endif // BASE_I18N_RTL_H_ 162 #endif // BASE_I18N_RTL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/notifications/balloon_host.h » ('j') | chrome/browser/notifications/balloon_host.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698