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/location.h" |
| 9 #include "base/single_thread_task_runner.h" |
9 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "base/thread_task_runner_handle.h" |
10 #include "chrome/browser/importer/importer_lock_dialog.h" | 12 #include "chrome/browser/importer/importer_lock_dialog.h" |
11 #include "chrome/grit/chromium_strings.h" | 13 #include "chrome/grit/chromium_strings.h" |
12 #include "chrome/grit/generated_resources.h" | 14 #include "chrome/grit/generated_resources.h" |
13 #include "chrome/grit/locale_settings.h" | 15 #include "chrome/grit/locale_settings.h" |
14 #include "content/public/browser/user_metrics.h" | 16 #include "content/public/browser/user_metrics.h" |
15 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
16 #include "ui/views/controls/label.h" | 18 #include "ui/views/controls/label.h" |
17 #include "ui/views/layout/layout_constants.h" | 19 #include "ui/views/layout/layout_constants.h" |
18 #include "ui/views/widget/widget.h" | 20 #include "ui/views/widget/widget.h" |
19 | 21 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 ui::DialogButton button) const { | 68 ui::DialogButton button) const { |
67 return l10n_util::GetStringUTF16((button == ui::DIALOG_BUTTON_OK) ? | 69 return l10n_util::GetStringUTF16((button == ui::DIALOG_BUTTON_OK) ? |
68 IDS_IMPORTER_LOCK_OK : IDS_IMPORTER_LOCK_CANCEL); | 70 IDS_IMPORTER_LOCK_OK : IDS_IMPORTER_LOCK_CANCEL); |
69 } | 71 } |
70 | 72 |
71 base::string16 ImportLockDialogView::GetWindowTitle() const { | 73 base::string16 ImportLockDialogView::GetWindowTitle() const { |
72 return l10n_util::GetStringUTF16(IDS_IMPORTER_LOCK_TITLE); | 74 return l10n_util::GetStringUTF16(IDS_IMPORTER_LOCK_TITLE); |
73 } | 75 } |
74 | 76 |
75 bool ImportLockDialogView::Accept() { | 77 bool ImportLockDialogView::Accept() { |
76 base::MessageLoop::current()->PostTask(FROM_HERE, | 78 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
77 base::Bind(callback_, true)); | 79 base::Bind(callback_, true)); |
78 return true; | 80 return true; |
79 } | 81 } |
80 | 82 |
81 bool ImportLockDialogView::Cancel() { | 83 bool ImportLockDialogView::Cancel() { |
82 base::MessageLoop::current()->PostTask(FROM_HERE, | 84 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
83 base::Bind(callback_, false)); | 85 base::Bind(callback_, false)); |
84 return true; | 86 return true; |
85 } | 87 } |
OLD | NEW |