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

Unified Diff: ui/views/controls/label.h

Issue 10695101: Remove code that forces text directionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove directionality forcing and modes; may be incorrect... Created 8 years, 5 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: ui/views/controls/label.h
diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h
index 523702597ef60b75f81bb7d55e5f1e508dee2968..bb9503c6fc7e7c7ba2f85256d85cdd164b210524 100644
--- a/ui/views/controls/label.h
+++ b/ui/views/controls/label.h
@@ -27,25 +27,11 @@ namespace views {
/////////////////////////////////////////////////////////////////////////////
class VIEWS_EXPORT Label : public View {
public:
+ // TODO(msw): Change to LEADING/TRAILING?
enum Alignment { ALIGN_LEFT = 0,
ALIGN_CENTER,
ALIGN_RIGHT };
- // The following enum is used to indicate whether using the Chrome UI's
- // directionality as the label's directionality, or auto-detecting the label's
- // directionality.
- //
- // If the label text originates from the Chrome UI, we should use the Chrome
- // UI's directionality as the label's directionality.
- //
- // If the text originates from a web page, its directionality is determined
- // based on its first character with strong directionality, disregarding what
- // directionality the Chrome UI is.
- enum DirectionalityMode {
- USE_UI_DIRECTIONALITY = 0,
- AUTO_DETECT_DIRECTIONALITY
- };
-
// The view class name.
static const char kViewClassName[];
@@ -101,29 +87,11 @@ class VIEWS_EXPORT Label : public View {
// Disables shadows.
void ClearEmbellishing();
- // Sets horizontal alignment. If the locale is RTL, and the directionality
- // mode is USE_UI_DIRECTIONALITY, the alignment is flipped around.
- //
- // Caveat: for labels originating from a web page, the directionality mode
- // should be reset to AUTO_DETECT_DIRECTIONALITY before the horizontal
- // alignment is set. Otherwise, the label's alignment specified as a parameter
- // will be flipped in RTL locales.
+ // Sets horizontal alignment; if the text is RTL, the alignment is flipped.
void SetHorizontalAlignment(Alignment alignment);
Alignment horizontal_alignment() const { return horiz_alignment_; }
- // Sets the directionality mode. The directionality mode is initialized to
- // USE_UI_DIRECTIONALITY when the label is constructed. USE_UI_DIRECTIONALITY
- // applies to every label that originates from the Chrome UI. However, if the
- // label originates from a web page, its directionality is auto-detected.
- void set_directionality_mode(DirectionalityMode mode) {
- directionality_mode_ = mode;
- }
-
- DirectionalityMode directionality_mode() const {
- return directionality_mode_;
- }
-
// Sets whether the label text can wrap on multiple lines.
// Default is false.
void SetMultiLine(bool multi_line);
@@ -280,10 +248,6 @@ class VIEWS_EXPORT Label : public View {
scoped_ptr<Background> mouse_over_background_;
// Whether to collapse the label when it's not visible.
bool collapse_when_hidden_;
- // The following member variable is used to control whether the
- // directionality is auto-detected based on first strong directionality
- // character or is determined by chrome UI's locale.
- DirectionalityMode directionality_mode_;
// When embedded in a larger control that is focusable, setting this flag
// allows this view to be painted as focused even when it is itself not.
bool paint_as_focused_;
« no previous file with comments | « ui/gfx/canvas_win.cc ('k') | ui/views/controls/label.cc » ('j') | ui/views/controls/label.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698