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

Unified 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: license 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 side-by-side diff with in-line comments
Download patch
Index: base/i18n/rtl.h
diff --git a/base/i18n/rtl.h b/base/i18n/rtl.h
index a75ed4f967bcd20bd42048994bf5114d51825917..d5b666571d035ddf76cc23af32b31f228e52e2ea 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,24 @@ 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_; }
+
+ bool empty() const { return string_.empty(); }
darin (slow to review) 2011/04/21 18:03:30 in chromium, we generally add a verb to methods li
Evan Martin 2011/04/21 18:11:52 In the equivalent WebKit review, I tried to add no
+
+ string16 string_;
darin (slow to review) 2011/04/21 18:03:30 nit: these should be marked private.
+ 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.
« no previous file with comments | « no previous file | chrome/browser/notifications/balloon_host.h » ('j') | content/browser/renderer_host/render_view_host.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698