summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-21 23:29:23 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-21 23:29:23 +0000
commit3fd22d99af8d466699b3078a72e15446b5bcbfe6 (patch)
treec70bed7386854214c622767dfc55e349ac3a9df8 /base
parent63c06a2b6ad7c90e0ff5b5d7496109c11c560e3b (diff)
downloadchromium_src-3fd22d99af8d466699b3078a72e15446b5bcbfe6.zip
chromium_src-3fd22d99af8d466699b3078a72e15446b5bcbfe6.tar.gz
chromium_src-3fd22d99af8d466699b3078a72e15446b5bcbfe6.tar.bz2
Add and use a base::i18n::StringWithDirection for carrying titles.
This is a refactoring of r82400. We're going to need the title direction in a bunch of different places; it's better to package it up as one object. BUG=27094 Review URL: http://codereview.chromium.org/6878089 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82582 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/i18n/rtl.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/base/i18n/rtl.h b/base/i18n/rtl.h
index a75ed4f..5159b46 100644
--- a/base/i18n/rtl.h
+++ b/base/i18n/rtl.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -31,6 +31,23 @@ enum TextDirection {
LEFT_TO_RIGHT,
};
+// A string along with the text direction it should be displayed in.
+// Conceptually this is a struct; we just use 'class' to make it easier for
+// others to forward-declare us with 'class String16WithDirection'.
+class String16WithDirection {
+ public:
+ String16WithDirection() : direction_(UNKNOWN_DIRECTION) { }
+ String16WithDirection(const string16& str, TextDirection dir)
+ : string_(str), direction_(dir) { }
+
+ const string16& string() const { return string_; }
+ TextDirection direction() const { return direction_; }
+
+ private:
+ string16 string_;
+ TextDirection direction_;
+};
+
// Get the locale that the currently running process has been configured to use.
// The return value is of the form language[-country] (e.g., en-US) where the
// language is the 2 or 3 letter code from ISO-639.