Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Side by Side Diff: chrome/browser/ui/cocoa/simple_message_box_mac.mm

Issue 2929953002: Make profile error dialog async (Closed)
Patch Set: for #3 comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/simple_message_box.h" 5 #include "chrome/browser/ui/simple_message_box.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include <utility>
10
11 #include "base/callback.h"
9 #include "base/mac/scoped_nsobject.h" 12 #include "base/mac/scoped_nsobject.h"
10 #include "base/strings/sys_string_conversions.h" 13 #include "base/strings/sys_string_conversions.h"
11 #include "chrome/browser/ui/simple_message_box_internal.h" 14 #include "chrome/browser/ui/simple_message_box_internal.h"
12 #include "chrome/grit/generated_resources.h" 15 #include "chrome/grit/generated_resources.h"
13 #include "components/startup_metric_utils/browser/startup_metric_utils.h" 16 #include "components/startup_metric_utils/browser/startup_metric_utils.h"
14 #include "components/strings/grit/components_strings.h" 17 #include "components/strings/grit/components_strings.h"
15 #include "ui/base/l10n/l10n_util_mac.h" 18 #include "ui/base/l10n/l10n_util_mac.h"
16 19
17 namespace chrome { 20 namespace chrome {
18 21
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 64
62 } // namespace 65 } // namespace
63 66
64 void ShowWarningMessageBox(gfx::NativeWindow parent, 67 void ShowWarningMessageBox(gfx::NativeWindow parent,
65 const base::string16& title, 68 const base::string16& title,
66 const base::string16& message) { 69 const base::string16& message) {
67 ShowMessageBox(parent, title, message, base::string16(), 70 ShowMessageBox(parent, title, message, base::string16(),
68 MESSAGE_BOX_TYPE_WARNING); 71 MESSAGE_BOX_TYPE_WARNING);
69 } 72 }
70 73
71 bool ShowWarningMessageBoxWithCheckbox(gfx::NativeWindow parent, 74 void ShowWarningMessageBoxWithCheckbox(
72 const base::string16& title, 75 gfx::NativeWindow parent,
73 const base::string16& message, 76 const base::string16& title,
74 const base::string16& checkbox_text) { 77 const base::string16& message,
78 const base::string16& checkbox_text,
79 base::OnceCallback<void(bool checked)> callback) {
75 ShowMessageBox(parent, title, message, checkbox_text, 80 ShowMessageBox(parent, title, message, checkbox_text,
76 MESSAGE_BOX_TYPE_WARNING); 81 MESSAGE_BOX_TYPE_WARNING);
77 return false; 82 std::move(callback).Run(false);
78 } 83 }
79 84
80 MessageBoxResult ShowQuestionMessageBox(gfx::NativeWindow parent, 85 MessageBoxResult ShowQuestionMessageBox(gfx::NativeWindow parent,
81 const base::string16& title, 86 const base::string16& title,
82 const base::string16& message) { 87 const base::string16& message) {
83 return ShowMessageBox(parent, title, message, base::string16(), 88 return ShowMessageBox(parent, title, message, base::string16(),
84 MESSAGE_BOX_TYPE_QUESTION); 89 MESSAGE_BOX_TYPE_QUESTION);
85 } 90 }
86 91
87 bool CloseMessageBoxForTest(bool accept) { 92 bool CloseMessageBoxForTest(bool accept) {
88 NOTIMPLEMENTED(); 93 NOTIMPLEMENTED();
89 return false; 94 return false;
90 } 95 }
91 96
92 } // namespace chrome 97 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/simple_message_box_android.cc ('k') | chrome/browser/ui/profile_error_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698