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

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

Issue 2929953002: Make profile error dialog async (Closed)
Patch Set: rebase 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
9 #include "base/mac/scoped_nsobject.h" 11 #include "base/mac/scoped_nsobject.h"
10 #include "base/strings/sys_string_conversions.h" 12 #include "base/strings/sys_string_conversions.h"
11 #include "chrome/browser/ui/simple_message_box_internal.h" 13 #include "chrome/browser/ui/simple_message_box_internal.h"
12 #include "chrome/grit/generated_resources.h" 14 #include "chrome/grit/generated_resources.h"
13 #include "components/startup_metric_utils/browser/startup_metric_utils.h" 15 #include "components/startup_metric_utils/browser/startup_metric_utils.h"
14 #include "components/strings/grit/components_strings.h" 16 #include "components/strings/grit/components_strings.h"
15 #include "ui/base/l10n/l10n_util_mac.h" 17 #include "ui/base/l10n/l10n_util_mac.h"
16 18
17 namespace chrome { 19 namespace chrome {
18 20
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 63
62 } // namespace 64 } // namespace
63 65
64 void ShowWarningMessageBox(gfx::NativeWindow parent, 66 void ShowWarningMessageBox(gfx::NativeWindow parent,
65 const base::string16& title, 67 const base::string16& title,
66 const base::string16& message) { 68 const base::string16& message) {
67 ShowMessageBox(parent, title, message, base::string16(), 69 ShowMessageBox(parent, title, message, base::string16(),
68 MESSAGE_BOX_TYPE_WARNING); 70 MESSAGE_BOX_TYPE_WARNING);
69 } 71 }
70 72
71 bool ShowWarningMessageBoxWithCheckbox(gfx::NativeWindow parent, 73 void ShowWarningMessageBoxWithCheckbox(
72 const base::string16& title, 74 gfx::NativeWindow parent,
73 const base::string16& message, 75 const base::string16& title,
74 const base::string16& checkbox_text) { 76 const base::string16& message,
77 const base::string16& checkbox_text,
78 base::OnceCallback<void(bool checked)> callback) {
75 ShowMessageBox(parent, title, message, checkbox_text, 79 ShowMessageBox(parent, title, message, checkbox_text,
76 MESSAGE_BOX_TYPE_WARNING); 80 MESSAGE_BOX_TYPE_WARNING);
77 return false; 81 std::move(callback).Run(false);
78 } 82 }
79 83
80 MessageBoxResult ShowQuestionMessageBox(gfx::NativeWindow parent, 84 MessageBoxResult ShowQuestionMessageBox(gfx::NativeWindow parent,
81 const base::string16& title, 85 const base::string16& title,
82 const base::string16& message) { 86 const base::string16& message) {
83 return ShowMessageBox(parent, title, message, base::string16(), 87 return ShowMessageBox(parent, title, message, base::string16(),
84 MESSAGE_BOX_TYPE_QUESTION); 88 MESSAGE_BOX_TYPE_QUESTION);
85 } 89 }
86 90
87 bool CloseMessageBoxForTest(bool accept) { 91 bool CloseMessageBoxForTest(bool accept) {
88 NOTIMPLEMENTED(); 92 NOTIMPLEMENTED();
89 return false; 93 return false;
90 } 94 }
91 95
92 } // namespace chrome 96 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698