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 "views/controls/message_box_view.h" | 5 #include "views/controls/message_box_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/message_box_flags.h" | 8 #include "app/message_box_flags.h" |
9 #include "base/clipboard.h" | 9 #include "base/clipboard.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // In addition, we should set the RTL alignment mode as | 130 // In addition, we should set the RTL alignment mode as |
131 // AUTO_DETECT_ALIGNMENT so that the alignment will not be flipped around | 131 // AUTO_DETECT_ALIGNMENT so that the alignment will not be flipped around |
132 // in RTL locales. | 132 // in RTL locales. |
133 message_label_->SetRTLAlignmentMode(views::Label::AUTO_DETECT_ALIGNMENT); | 133 message_label_->SetRTLAlignmentMode(views::Label::AUTO_DETECT_ALIGNMENT); |
134 message_label_->SetHorizontalAlignment(alignment); | 134 message_label_->SetHorizontalAlignment(alignment); |
135 } else { | 135 } else { |
136 message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 136 message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
137 } | 137 } |
138 | 138 |
139 if (dialog_flags & MessageBoxFlags::kFlagHasPromptField) { | 139 if (dialog_flags & MessageBoxFlags::kFlagHasPromptField) { |
140 prompt_field_ = new views::TextField; | 140 prompt_field_ = new views::Textfield; |
141 prompt_field_->SetText(default_prompt); | 141 prompt_field_->SetText(default_prompt); |
142 } | 142 } |
143 | 143 |
144 ResetLayoutManager(); | 144 ResetLayoutManager(); |
145 } | 145 } |
146 | 146 |
147 void MessageBoxView::ResetLayoutManager() { | 147 void MessageBoxView::ResetLayoutManager() { |
148 using views::GridLayout; | 148 using views::GridLayout; |
149 using views::ColumnSet; | 149 using views::ColumnSet; |
150 | 150 |
(...skipping 11 matching lines...) Expand all Loading... |
162 ColumnSet* column_set = layout->AddColumnSet(message_column_view_set_id); | 162 ColumnSet* column_set = layout->AddColumnSet(message_column_view_set_id); |
163 if (icon_) { | 163 if (icon_) { |
164 column_set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, | 164 column_set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, |
165 GridLayout::FIXED, icon_size.width(), | 165 GridLayout::FIXED, icon_size.width(), |
166 icon_size.height()); | 166 icon_size.height()); |
167 column_set->AddPaddingColumn(0, kUnrelatedControlHorizontalSpacing); | 167 column_set->AddPaddingColumn(0, kUnrelatedControlHorizontalSpacing); |
168 } | 168 } |
169 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, | 169 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, |
170 GridLayout::FIXED, message_width_, 0); | 170 GridLayout::FIXED, message_width_, 0); |
171 | 171 |
172 // Column set for prompt textfield, if one has been set. | 172 // Column set for prompt Textfield, if one has been set. |
173 const int textfield_column_view_set_id = 1; | 173 const int textfield_column_view_set_id = 1; |
174 if (prompt_field_) { | 174 if (prompt_field_) { |
175 column_set = layout->AddColumnSet(textfield_column_view_set_id); | 175 column_set = layout->AddColumnSet(textfield_column_view_set_id); |
176 if (icon_) { | 176 if (icon_) { |
177 column_set->AddPaddingColumn(0, | 177 column_set->AddPaddingColumn(0, |
178 icon_size.width() + kUnrelatedControlHorizontalSpacing); | 178 icon_size.width() + kUnrelatedControlHorizontalSpacing); |
179 } | 179 } |
180 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, | 180 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, |
181 GridLayout::USE_PREF, 0, 0); | 181 GridLayout::USE_PREF, 0, 0); |
182 } | 182 } |
(...skipping 23 matching lines...) Expand all Loading... |
206 } | 206 } |
207 | 207 |
208 if (checkbox_) { | 208 if (checkbox_) { |
209 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 209 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
210 layout->StartRow(0, checkbox_column_view_set_id); | 210 layout->StartRow(0, checkbox_column_view_set_id); |
211 layout->AddView(checkbox_); | 211 layout->AddView(checkbox_); |
212 } | 212 } |
213 | 213 |
214 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 214 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
215 } | 215 } |
OLD | NEW |