OLD | NEW |
| (Empty) |
1 // Copyright (c) 2009 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 // A dialog box that tells the user that we can't write to the specified user | |
6 // data directory. Provides the user a chance to pick a different directory. | |
7 | |
8 #ifndef CHROME_BROWSER_BLACKLIST_ERROR_DIALOG_H_ | |
9 #define CHROME_BROWSER_BLACKLIST_ERROR_DIALOG_H_ | |
10 | |
11 #include "base/message_loop.h" | |
12 #include "views/window/dialog_delegate.h" | |
13 | |
14 class MessageBoxView; | |
15 | |
16 namespace views { | |
17 class Window; | |
18 } // namespace views | |
19 | |
20 class BlacklistErrorDialog : public views::DialogDelegate, | |
21 public MessageLoopForUI::Dispatcher { | |
22 public: | |
23 // Creates and runs a blacklist error dialog which is displayed modally | |
24 // to the user so that they know and acknowledge that their privacy is | |
25 // not protected. | |
26 static bool RunBlacklistErrorDialog(); | |
27 | |
28 virtual ~BlacklistErrorDialog(); | |
29 bool accepted() const { return accepted_; } | |
30 | |
31 // views::DialogDelegate Methods: | |
32 virtual std::wstring GetDialogButtonLabel( | |
33 MessageBoxFlags::DialogButton button) const; | |
34 virtual std::wstring GetWindowTitle() const; | |
35 virtual void DeleteDelegate(); | |
36 virtual bool Accept(); | |
37 virtual bool Cancel(); | |
38 | |
39 // views::WindowDelegate Methods: | |
40 virtual bool IsAlwaysOnTop() const { return false; } | |
41 virtual bool IsModal() const { return false; } | |
42 virtual views::View* GetContentsView(); | |
43 | |
44 // MessageLoop::Dispatcher Method: | |
45 virtual bool Dispatch(const MSG& msg); | |
46 | |
47 private: | |
48 BlacklistErrorDialog(); | |
49 | |
50 MessageBoxView* box_view_; | |
51 | |
52 // Used to keep track of whether or not to block the message loop (still | |
53 // waiting for the user to dismiss the dialog). | |
54 bool is_blocking_; | |
55 bool accepted_; | |
56 | |
57 DISALLOW_COPY_AND_ASSIGN(BlacklistErrorDialog); | |
58 }; | |
59 | |
60 #endif // CHROME_BROWSER_BLACKLIST_ERROR_DIALOG_H_ | |
OLD | NEW |