| 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/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/importer/importer_lock_dialog.h" | 10 #include "chrome/browser/importer/importer_lock_dialog.h" |
| 11 #include "content/public/browser/user_metrics.h" | 11 #include "content/public/browser/user_metrics.h" |
| 12 #include "grit/chromium_strings.h" | 12 #include "grit/chromium_strings.h" |
| 13 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
| 14 #include "grit/locale_settings.h" | 14 #include "grit/locale_settings.h" |
| 15 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
| 16 #include "ui/views/controls/label.h" | 16 #include "ui/views/controls/label.h" |
| 17 #include "ui/views/layout/layout_constants.h" | 17 #include "ui/views/layout/layout_constants.h" |
| 18 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
| 19 | 19 |
| 20 using content::UserMetricsAction; | 20 using content::UserMetricsAction; |
| 21 | 21 |
| 22 // Default size of the dialog window. | |
| 23 static const int kDefaultWindowWidth = 320; | |
| 24 static const int kDefaultWindowHeight = 100; | |
| 25 | |
| 26 namespace importer { | 22 namespace importer { |
| 27 | 23 |
| 28 void ShowImportLockDialog(gfx::NativeWindow parent, | 24 void ShowImportLockDialog(gfx::NativeWindow parent, |
| 29 const base::Callback<void(bool)>& callback) { | 25 const base::Callback<void(bool)>& callback) { |
| 30 ImportLockDialogView::Show(parent, callback); | 26 ImportLockDialogView::Show(parent, callback); |
| 31 content::RecordAction(UserMetricsAction("ImportLockDialogView_Shown")); | 27 content::RecordAction(UserMetricsAction("ImportLockDialogView_Shown")); |
| 32 } | 28 } |
| 33 | 29 |
| 34 } // namespace importer | 30 } // namespace importer |
| 35 | 31 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 base::MessageLoop::current()->PostTask(FROM_HERE, | 86 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 91 base::Bind(callback_, true)); | 87 base::Bind(callback_, true)); |
| 92 return true; | 88 return true; |
| 93 } | 89 } |
| 94 | 90 |
| 95 bool ImportLockDialogView::Cancel() { | 91 bool ImportLockDialogView::Cancel() { |
| 96 base::MessageLoop::current()->PostTask(FROM_HERE, | 92 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 97 base::Bind(callback_, false)); | 93 base::Bind(callback_, false)); |
| 98 return true; | 94 return true; |
| 99 } | 95 } |
| OLD | NEW |