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

Unified Diff: public/web/WebTextDirection.h

Issue 470883002: Add |WebTextDirection toWebTextDirection(TextDirection)|. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 4 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
« no previous file with comments | « public/web/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/web/WebTextDirection.h
diff --git a/public/web/WebTextDirection.h b/public/web/WebTextDirection.h
index a236c86c6bf536aca7824a101b99d3a685a72ec3..cd350c9620e10a0e3ca847851b8eb4715d7673f6 100644
--- a/public/web/WebTextDirection.h
+++ b/public/web/WebTextDirection.h
@@ -31,6 +31,10 @@
#ifndef WebTextDirection_h
#define WebTextDirection_h
+#if BLINK_IMPLEMENTATION
+#include "platform/text/TextDirection.h"
+#endif
+
namespace blink {
// Represents text directions (or writing directions) of a DOM node.
@@ -41,6 +45,20 @@ enum WebTextDirection {
WebTextDirectionLast = WebTextDirectionRightToLeft
};
+#if BLINK_IMPLEMENTATION
+inline WebTextDirection toWebTextDirection(TextDirection direction)
+{
+ switch (direction) {
+ case LTR:
+ return WebTextDirectionLeftToRight;
+ case RTL:
+ return WebTextDirectionRightToLeft;
+ }
+ ASSERT_NOT_REACHED();
+ return WebTextDirectionDefault;
+}
+#endif
+
} // namespace blink
#endif
« no previous file with comments | « public/web/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698