OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/views/controls/message_box_view.h" | 5 #include "chrome/views/controls/message_box_view.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/scoped_clipboard_writer.h" | 8 #include "base/scoped_clipboard_writer.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 scw.WriteText(message_label_->GetText()); | 103 scw.WriteText(message_label_->GetText()); |
104 return true; | 104 return true; |
105 } | 105 } |
106 | 106 |
107 /////////////////////////////////////////////////////////////////////////////// | 107 /////////////////////////////////////////////////////////////////////////////// |
108 // MessageBoxView, private: | 108 // MessageBoxView, private: |
109 | 109 |
110 void MessageBoxView::Init(int dialog_flags, | 110 void MessageBoxView::Init(int dialog_flags, |
111 const std::wstring& default_prompt) { | 111 const std::wstring& default_prompt) { |
112 message_label_->SetMultiLine(true); | 112 message_label_->SetMultiLine(true); |
| 113 message_label_->SetAllowCharacterBreak(true); |
113 if (dialog_flags & MessageBoxFlags::kAutoDetectAlignment) { | 114 if (dialog_flags & MessageBoxFlags::kAutoDetectAlignment) { |
114 // Determine the alignment and directionality based on the first character | 115 // Determine the alignment and directionality based on the first character |
115 // with strong directionality. | 116 // with strong directionality. |
116 l10n_util::TextDirection direction = | 117 l10n_util::TextDirection direction = |
117 l10n_util::GetFirstStrongCharacterDirection(message_label_->GetText()); | 118 l10n_util::GetFirstStrongCharacterDirection(message_label_->GetText()); |
118 views::Label::Alignment alignment; | 119 views::Label::Alignment alignment; |
119 if (direction == l10n_util::RIGHT_TO_LEFT) | 120 if (direction == l10n_util::RIGHT_TO_LEFT) |
120 alignment = views::Label::ALIGN_RIGHT; | 121 alignment = views::Label::ALIGN_RIGHT; |
121 else | 122 else |
122 alignment = views::Label::ALIGN_LEFT; | 123 alignment = views::Label::ALIGN_LEFT; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 200 } |
200 | 201 |
201 if (checkbox_) { | 202 if (checkbox_) { |
202 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 203 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
203 layout->StartRow(0, checkbox_column_view_set_id); | 204 layout->StartRow(0, checkbox_column_view_set_id); |
204 layout->AddView(checkbox_); | 205 layout->AddView(checkbox_); |
205 } | 206 } |
206 | 207 |
207 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 208 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
208 } | 209 } |
OLD | NEW |