OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/ui/views/autofill/autofill_dialog_views.h" | 5 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 8 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
9 #include "chrome/browser/ui/autofill/autofill_dialog_template.h" | 9 #include "chrome/browser/ui/autofill/autofill_dialog_template.h" |
10 #include "chrome/browser/ui/views/constrained_window_views.h" | 10 #include "chrome/browser/ui/views/constrained_window_views.h" |
11 #include "ui/views/border.h" | 11 #include "ui/views/border.h" |
12 #include "ui/views/controls/button/checkbox.h" | 12 #include "ui/views/controls/button/checkbox.h" |
13 #include "ui/views/controls/combobox/combobox.h" | 13 #include "ui/views/controls/combobox/combobox.h" |
14 #include "ui/views/controls/label.h" | 14 #include "ui/views/controls/label.h" |
15 #include "ui/views/controls/separator.h" | 15 #include "ui/views/controls/separator.h" |
16 #include "ui/views/controls/textfield/textfield.h" | 16 #include "ui/views/controls/textfield/textfield.h" |
17 #include "ui/views/layout/box_layout.h" | 17 #include "ui/views/layout/box_layout.h" |
18 #include "ui/views/layout/grid_layout.h" | 18 #include "ui/views/layout/grid_layout.h" |
19 #include "ui/views/layout/layout_constants.h" | 19 #include "ui/views/layout/layout_constants.h" |
20 | 20 |
21 namespace autofill { | 21 namespace autofill { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 // Returns a label that describes a details section. | 25 // Returns a label that describes a details section. |
26 views::Label* CreateDetailsSectionLabel(const string16& text) { | 26 views::Label* CreateDetailsSectionLabel(const string16& text) { |
27 views::Label* label = new views::Label(text); | 27 views::Label* label = new views::Label(text); |
28 label->SetHorizontalAlignment(views::Label::ALIGN_RIGHT); | 28 label->SetHorizontalAlignment(gfx::ALIGN_RIGHT); |
29 label->SetFont(label->font().DeriveFont(0, gfx::Font::BOLD)); | 29 label->SetFont(label->font().DeriveFont(0, gfx::Font::BOLD)); |
30 // TODO(estade): this should be made to match the native textfield top | 30 // TODO(estade): this should be made to match the native textfield top |
31 // inset. It's hard to get at, so for now it's hard-coded. | 31 // inset. It's hard to get at, so for now it's hard-coded. |
32 label->set_border(views::Border::CreateEmptyBorder(4, 0, 0, 0)); | 32 label->set_border(views::Border::CreateEmptyBorder(4, 0, 0, 0)); |
33 return label; | 33 return label; |
34 } | 34 } |
35 | 35 |
36 } // namespace | 36 } // namespace |
37 | 37 |
38 // static | 38 // static |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 views::ColumnSet* column_set = layout->AddColumnSet(single_column_set); | 134 views::ColumnSet* column_set = layout->AddColumnSet(single_column_set); |
135 column_set->AddColumn(views::GridLayout::FILL, | 135 column_set->AddColumn(views::GridLayout::FILL, |
136 views::GridLayout::FILL, | 136 views::GridLayout::FILL, |
137 1, | 137 1, |
138 views::GridLayout::USE_PREF, | 138 views::GridLayout::USE_PREF, |
139 0, | 139 0, |
140 0); | 140 0); |
141 | 141 |
142 layout->StartRow(0, single_column_set); | 142 layout->StartRow(0, single_column_set); |
143 views::Label* intro = new views::Label(controller_->IntroText()); | 143 views::Label* intro = new views::Label(controller_->IntroText()); |
144 intro->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 144 intro->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
145 layout->AddView(intro); | 145 layout->AddView(intro); |
146 | 146 |
147 layout->StartRowWithPadding(0, single_column_set, | 147 layout->StartRowWithPadding(0, single_column_set, |
148 0, views::kUnrelatedControlVerticalSpacing); | 148 0, views::kUnrelatedControlVerticalSpacing); |
149 layout->AddView(CreateDetailsContainer()); | 149 layout->AddView(CreateDetailsContainer()); |
150 | 150 |
151 // Separator. | 151 // Separator. |
152 layout->StartRowWithPadding(0, single_column_set, | 152 layout->StartRowWithPadding(0, single_column_set, |
153 0, views::kUnrelatedControlVerticalSpacing); | 153 0, views::kUnrelatedControlVerticalSpacing); |
154 layout->AddView(new views::Separator()); | 154 layout->AddView(new views::Separator()); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 combobox->SetVisible(show_combobox); | 318 combobox->SetVisible(show_combobox); |
319 group.manual_input->SetVisible(!show_combobox); | 319 group.manual_input->SetVisible(!show_combobox); |
320 } | 320 } |
321 | 321 |
322 AutofillDialogViews::DetailsGroup::DetailsGroup() | 322 AutofillDialogViews::DetailsGroup::DetailsGroup() |
323 : container(NULL), | 323 : container(NULL), |
324 suggested_input(NULL), | 324 suggested_input(NULL), |
325 manual_input(NULL) {} | 325 manual_input(NULL) {} |
326 | 326 |
327 } // namespace autofill | 327 } // namespace autofill |
OLD | NEW |