| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
| 11 #include "chrome/browser/importer/importer_lock_dialog.h" | 11 #include "chrome/browser/importer/importer_lock_dialog.h" |
| 12 #include "content/browser/user_metrics.h" | 12 #include "content/public/browser/user_metrics.h" |
| 13 #include "grit/chromium_strings.h" | 13 #include "grit/chromium_strings.h" |
| 14 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
| 15 #include "grit/locale_settings.h" | 15 #include "grit/locale_settings.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/views/controls/label.h" | 17 #include "ui/views/controls/label.h" |
| 18 #include "ui/views/layout/layout_constants.h" | 18 #include "ui/views/layout/layout_constants.h" |
| 19 #include "ui/views/widget/widget.h" | 19 #include "ui/views/widget/widget.h" |
| 20 | 20 |
| 21 using content::UserMetricsAction; |
| 22 |
| 21 // Default size of the dialog window. | 23 // Default size of the dialog window. |
| 22 static const int kDefaultWindowWidth = 320; | 24 static const int kDefaultWindowWidth = 320; |
| 23 static const int kDefaultWindowHeight = 100; | 25 static const int kDefaultWindowHeight = 100; |
| 24 | 26 |
| 25 namespace importer { | 27 namespace importer { |
| 26 | 28 |
| 27 void ShowImportLockDialog(gfx::NativeWindow parent, | 29 void ShowImportLockDialog(gfx::NativeWindow parent, |
| 28 ImporterHost* importer_host) { | 30 ImporterHost* importer_host) { |
| 29 ImportLockDialogView::Show(parent, importer_host); | 31 ImportLockDialogView::Show(parent, importer_host); |
| 30 UserMetrics::RecordAction(UserMetricsAction("ImportLockDialogView_Shown")); | 32 content::RecordAction(UserMetricsAction("ImportLockDialogView_Shown")); |
| 31 } | 33 } |
| 32 | 34 |
| 33 } // namespace importer | 35 } // namespace importer |
| 34 | 36 |
| 35 // static | 37 // static |
| 36 void ImportLockDialogView::Show(gfx::NativeWindow parent, | 38 void ImportLockDialogView::Show(gfx::NativeWindow parent, |
| 37 ImporterHost* importer_host) { | 39 ImporterHost* importer_host) { |
| 38 views::Widget::CreateWindow(new ImportLockDialogView(importer_host))->Show(); | 40 views::Widget::CreateWindow(new ImportLockDialogView(importer_host))->Show(); |
| 39 } | 41 } |
| 40 | 42 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 MessageLoop::current()->PostTask( | 96 MessageLoop::current()->PostTask( |
| 95 FROM_HERE, | 97 FROM_HERE, |
| 96 base::Bind(&ImporterHost::OnImportLockDialogEnd, | 98 base::Bind(&ImporterHost::OnImportLockDialogEnd, |
| 97 importer_host_.get(), false)); | 99 importer_host_.get(), false)); |
| 98 return true; | 100 return true; |
| 99 } | 101 } |
| 100 | 102 |
| 101 views::View* ImportLockDialogView::GetContentsView() { | 103 views::View* ImportLockDialogView::GetContentsView() { |
| 102 return this; | 104 return this; |
| 103 } | 105 } |
| OLD | NEW |