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

Unified Diff: app/gfx/canvas.cc

Issue 1073005: Move RTL related functions from app/l10n_util to base/i18n/rtl... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 | « app/gfx/canvas.h ('k') | app/gfx/canvas_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/gfx/canvas.cc
===================================================================
--- app/gfx/canvas.cc (revision 42180)
+++ app/gfx/canvas.cc (working copy)
@@ -8,6 +8,7 @@
#include "app/gfx/font.h"
#include "app/l10n_util.h"
+#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "gfx/rect.h"
#include "third_party/skia/include/core/SkShader.h"
@@ -218,7 +219,7 @@
const SkColor& color,
int x, int y, int w, int h) {
DrawStringInt(text, font, color, x, y, w, h,
- l10n_util::DefaultCanvasTextAlignment());
+ gfx::Canvas::DefaultCanvasTextAlignment());
}
void Canvas::DrawStringInt(const std::wstring& text,
@@ -267,4 +268,11 @@
return result;
}
+// static
+int Canvas::DefaultCanvasTextAlignment() {
+ if (!base::i18n::IsRTL())
+ return gfx::Canvas::TEXT_ALIGN_LEFT;
+ return gfx::Canvas::TEXT_ALIGN_RIGHT;
+}
+
} // namespace gfx
« no previous file with comments | « app/gfx/canvas.h ('k') | app/gfx/canvas_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698