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/browser/views/importer_view.h" | 5 #include "chrome/browser/views/importer_view.h" |
6 | 6 |
7 #include "chrome/app/locales/locale_settings.h" | 7 #include "chrome/app/locales/locale_settings.h" |
8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
9 #include "chrome/browser/views/standard_layout.h" | 9 #include "chrome/browser/views/standard_layout.h" |
10 #include "chrome/common/l10n_util.h" | 10 #include "chrome/common/l10n_util.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 layout->AddView(search_engines_checkbox_, 3, 1); | 81 layout->AddView(search_engines_checkbox_, 3, 1); |
82 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 82 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
83 layout->StartRow(0, column_set_id); | 83 layout->StartRow(0, column_set_id); |
84 layout->AddView(passwords_checkbox_, 3, 1); | 84 layout->AddView(passwords_checkbox_, 3, 1); |
85 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 85 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
86 layout->StartRow(0, column_set_id); | 86 layout->StartRow(0, column_set_id); |
87 layout->AddView(history_checkbox_, 3, 1); | 87 layout->AddView(history_checkbox_, 3, 1); |
88 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 88 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
89 } | 89 } |
90 | 90 |
91 void ImporterView::GetPreferredSize(CSize *out) { | 91 gfx::Size ImporterView::GetPreferredSize() { |
92 DCHECK(out); | 92 return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( |
93 *out = ChromeViews::Window::GetLocalizedContentsSize( | |
94 IDS_IMPORT_DIALOG_WIDTH_CHARS, | 93 IDS_IMPORT_DIALOG_WIDTH_CHARS, |
95 IDS_IMPORT_DIALOG_HEIGHT_LINES).ToSIZE(); | 94 IDS_IMPORT_DIALOG_HEIGHT_LINES)); |
96 } | 95 } |
97 | 96 |
98 void ImporterView::Layout() { | 97 void ImporterView::Layout() { |
99 GetLayoutManager()->Layout(this); | 98 GetLayoutManager()->Layout(this); |
100 } | 99 } |
101 | 100 |
102 std::wstring ImporterView::GetDialogButtonLabel( | 101 std::wstring ImporterView::GetDialogButtonLabel( |
103 DialogButton button) const { | 102 DialogButton button) const { |
104 if (button == DIALOGBUTTON_OK) { | 103 if (button == DIALOGBUTTON_OK) { |
105 return l10n_util::GetString(IDS_IMPORT_COMMIT); | 104 return l10n_util::GetString(IDS_IMPORT_COMMIT); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 window()->Close(); | 168 window()->Close(); |
170 } | 169 } |
171 | 170 |
172 ChromeViews::CheckBox* ImporterView::InitCheckbox( | 171 ChromeViews::CheckBox* ImporterView::InitCheckbox( |
173 const std::wstring& text, bool checked) { | 172 const std::wstring& text, bool checked) { |
174 ChromeViews::CheckBox* checkbox = new ChromeViews::CheckBox(text); | 173 ChromeViews::CheckBox* checkbox = new ChromeViews::CheckBox(text); |
175 checkbox->SetIsSelected(checked); | 174 checkbox->SetIsSelected(checked); |
176 return checkbox; | 175 return checkbox; |
177 } | 176 } |
178 | 177 |
OLD | NEW |