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/importer/import_lock_dialog_view.h" | 5 #include "chrome/browser/ui/views/importer/import_lock_dialog_view.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/importer/importer_host.h" | 10 #include "chrome/browser/importer/importer_host.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 ImporterHost* importer_host) { | 39 ImporterHost* importer_host) { |
40 views::Widget::CreateWindow(new ImportLockDialogView(importer_host))->Show(); | 40 views::Widget::CreateWindow(new ImportLockDialogView(importer_host))->Show(); |
41 } | 41 } |
42 | 42 |
43 ImportLockDialogView::ImportLockDialogView(ImporterHost* importer_host) | 43 ImportLockDialogView::ImportLockDialogView(ImporterHost* importer_host) |
44 : description_label_(NULL), | 44 : description_label_(NULL), |
45 importer_host_(importer_host) { | 45 importer_host_(importer_host) { |
46 description_label_ = new views::Label( | 46 description_label_ = new views::Label( |
47 l10n_util::GetStringUTF16(IDS_IMPORTER_LOCK_TEXT)); | 47 l10n_util::GetStringUTF16(IDS_IMPORTER_LOCK_TEXT)); |
48 description_label_->SetMultiLine(true); | 48 description_label_->SetMultiLine(true); |
49 description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 49 description_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
50 AddChildView(description_label_); | 50 AddChildView(description_label_); |
51 } | 51 } |
52 | 52 |
53 ImportLockDialogView::~ImportLockDialogView() { | 53 ImportLockDialogView::~ImportLockDialogView() { |
54 } | 54 } |
55 | 55 |
56 gfx::Size ImportLockDialogView::GetPreferredSize() { | 56 gfx::Size ImportLockDialogView::GetPreferredSize() { |
57 return gfx::Size(views::Widget::GetLocalizedContentsSize( | 57 return gfx::Size(views::Widget::GetLocalizedContentsSize( |
58 IDS_IMPORTLOCK_DIALOG_WIDTH_CHARS, | 58 IDS_IMPORTLOCK_DIALOG_WIDTH_CHARS, |
59 IDS_IMPORTLOCK_DIALOG_HEIGHT_LINES)); | 59 IDS_IMPORTLOCK_DIALOG_HEIGHT_LINES)); |
(...skipping 29 matching lines...) Expand all Loading... |
89 MessageLoop::current()->PostTask( | 89 MessageLoop::current()->PostTask( |
90 FROM_HERE, | 90 FROM_HERE, |
91 base::Bind(&ImporterHost::OnImportLockDialogEnd, | 91 base::Bind(&ImporterHost::OnImportLockDialogEnd, |
92 importer_host_.get(), false)); | 92 importer_host_.get(), false)); |
93 return true; | 93 return true; |
94 } | 94 } |
95 | 95 |
96 views::View* ImportLockDialogView::GetContentsView() { | 96 views::View* ImportLockDialogView::GetContentsView() { |
97 return this; | 97 return this; |
98 } | 98 } |
OLD | NEW |