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

Side by Side Diff: views/controls/message_box_view.cc

Issue 115825: Move text_field.cc and rename the class to Textfield in preparation for porti... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/message_box_view.h ('k') | views/controls/text_field.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « views/controls/message_box_view.h ('k') | views/controls/text_field.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698