OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_HOST_CHROMEOS_MESSAGE_BOX_H_ | |
6 #define REMOTING_HOST_CHROMEOS_MESSAGE_BOX_H_ | |
7 | |
8 #include "base/callback_helpers.h" | |
9 #include "base/strings/string16.h" | |
10 #include "base/threading/thread_checker.h" | |
11 | |
12 namespace remoting { | |
13 | |
14 // Overview: | |
15 // Shows a system modal message box with OK and cancel buttons. This class | |
16 // is not thread-safe, it must be called on the UI thread of the browser | |
17 // process. | |
18 class MessageBox { | |
19 public: | |
20 enum Result { | |
21 OK, | |
22 CANCEL | |
23 }; | |
24 | |
25 // ResultCallback will be invoked with Result::Cancel if the user closes the | |
26 // MessageBox without clicking on any buttons. | |
27 typedef base::Callback<void(Result)> ResultCallback; | |
28 | |
29 MessageBox(const base::string16& title_label, | |
30 const base::string16& message_label, | |
31 const base::string16& ok_label, | |
32 const base::string16& cancel_label, | |
33 ResultCallback result_callback); | |
34 ~MessageBox(); | |
35 | |
36 void Show(); | |
37 void Hide(); | |
38 | |
39 private: | |
40 class Core; | |
41 Core* core_; | |
42 base::ThreadChecker thread_checker_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(MessageBox); | |
45 }; | |
46 | |
47 } // namespace remoting | |
48 | |
49 #endif // REMOTING_HOST_CHROMEOS_MESSAGE_BOX_H_ | |
OLD | NEW |