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_lock_view.h" | 5 #include "chrome/browser/views/importer_lock_view.h" |
6 | 6 |
7 #include "chrome/app/locales/locale_settings.h" | 7 #include "chrome/app/locales/locale_settings.h" |
8 #include "chrome/browser/importer/importer.h" | 8 #include "chrome/browser/importer/importer.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 16 matching lines...) Expand all Loading... |
27 description_label_ = new ChromeViews::Label( | 27 description_label_ = new ChromeViews::Label( |
28 l10n_util::GetString(IDS_IMPORTER_LOCK_TEXT)); | 28 l10n_util::GetString(IDS_IMPORTER_LOCK_TEXT)); |
29 description_label_->SetMultiLine(true); | 29 description_label_->SetMultiLine(true); |
30 description_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); | 30 description_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); |
31 AddChildView(description_label_); | 31 AddChildView(description_label_); |
32 } | 32 } |
33 | 33 |
34 ImporterLockView::~ImporterLockView() { | 34 ImporterLockView::~ImporterLockView() { |
35 } | 35 } |
36 | 36 |
37 void ImporterLockView::GetPreferredSize(CSize *out) { | 37 gfx::Size ImporterLockView::GetPreferredSize() { |
38 DCHECK(out); | 38 return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( |
39 *out = ChromeViews::Window::GetLocalizedContentsSize( | |
40 IDS_IMPORTLOCK_DIALOG_WIDTH_CHARS, | 39 IDS_IMPORTLOCK_DIALOG_WIDTH_CHARS, |
41 IDS_IMPORTLOCK_DIALOG_HEIGHT_LINES).ToSIZE(); | 40 IDS_IMPORTLOCK_DIALOG_HEIGHT_LINES)); |
42 } | 41 } |
43 | 42 |
44 void ImporterLockView::Layout() { | 43 void ImporterLockView::Layout() { |
45 description_label_->SetBounds(kPanelHorizMargin, kPanelVertMargin, | 44 description_label_->SetBounds(kPanelHorizMargin, kPanelVertMargin, |
46 width() - 2 * kPanelHorizMargin, | 45 width() - 2 * kPanelHorizMargin, |
47 height() - 2 * kPanelVertMargin); | 46 height() - 2 * kPanelVertMargin); |
48 } | 47 } |
49 | 48 |
50 std::wstring ImporterLockView::GetDialogButtonLabel( | 49 std::wstring ImporterLockView::GetDialogButtonLabel( |
51 DialogButton button) const { | 50 DialogButton button) const { |
(...skipping 22 matching lines...) Expand all Loading... |
74 bool ImporterLockView::Cancel() { | 73 bool ImporterLockView::Cancel() { |
75 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( | 74 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( |
76 importer_host_, &ImporterHost::OnLockViewEnd, false)); | 75 importer_host_, &ImporterHost::OnLockViewEnd, false)); |
77 return true; | 76 return true; |
78 } | 77 } |
79 | 78 |
80 ChromeViews::View* ImporterLockView::GetContentsView() { | 79 ChromeViews::View* ImporterLockView::GetContentsView() { |
81 return this; | 80 return this; |
82 } | 81 } |
83 | 82 |
OLD | NEW |