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

Unified Diff: ui/views/controls/message_box_view.cc

Issue 10695101: Remove code that forces text directionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge. 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
« no previous file with comments | « ui/views/controls/label_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/message_box_view.cc
diff --git a/ui/views/controls/message_box_view.cc b/ui/views/controls/message_box_view.cc
index 960b3161b8a09d0e1b4068725635a66df7fb099d..a392a0c8f486aa9346715f96e971bb128dcf3318 100644
--- a/ui/views/controls/message_box_view.cc
+++ b/ui/views/controls/message_box_view.cc
@@ -162,27 +162,23 @@ void MessageBoxView::Init(const InitParams& params) {
if (params.options & DETECT_DIRECTIONALITY) {
std::vector<string16> texts;
SplitStringIntoParagraphs(params.message, &texts);
- // If the text originates from a web page, its alignment is based on its
- // first character with strong directionality.
- base::i18n::TextDirection message_direction =
- base::i18n::GetFirstStrongCharacterDirection(params.message);
- Label::Alignment alignment =
- (message_direction == base::i18n::RIGHT_TO_LEFT) ?
- Label::ALIGN_RIGHT : Label::ALIGN_LEFT;
for (size_t i = 0; i < texts.size(); ++i) {
Label* message_label = new Label(texts[i]);
// Don't set multi-line to true if the text is empty, else the label will
// have a height of 0.
message_label->SetMultiLine(!texts[i].empty());
message_label->SetAllowCharacterBreak(true);
- message_label->set_directionality_mode(Label::AUTO_DETECT_DIRECTIONALITY);
- message_label->SetHorizontalAlignment(alignment);
+ // TODO(msw): Remove Options::DETECT_DIRECTIONALITY and split all text into paragraphs???
+ // message_label->set_directionality_mode(Label::AUTO_DETECT_DIRECTIONALITY);
+ // TODO(msw): Set leading... Test RTL with this value (that should mean "leading"...).
+ message_label->SetHorizontalAlignment(Label::ALIGN_LEFT);
message_labels_.push_back(message_label);
}
} else {
Label* message_label = new Label(params.message);
message_label->SetMultiLine(true);
message_label->SetAllowCharacterBreak(true);
+ // TODO(msw): Set leading...
message_label->SetHorizontalAlignment(Label::ALIGN_LEFT);
message_labels_.push_back(message_label);
}
« no previous file with comments | « ui/views/controls/label_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698