OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef EXTENSIONS_BROWSER_EXTENSION_DIALOG_AUTO_CONFIRM_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_DIALOG_AUTO_CONFIRM_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_DIALOG_AUTO_CONFIRM_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_DIALOG_AUTO_CONFIRM_H_ |
7 | 7 |
8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 | 10 |
11 namespace extensions { | 11 namespace extensions { |
12 | 12 |
13 class ScopedTestDialogAutoConfirm { | 13 class ScopedTestDialogAutoConfirm { |
14 public: | 14 public: |
15 enum AutoConfirm { | 15 enum AutoConfirm { |
16 NONE, // The prompt will show normally. | 16 NONE, // The prompt will show normally. |
17 ACCEPT, // The prompt will always accept. | 17 ACCEPT, // The prompt will always accept. |
18 CANCEL, // The prompt will always cancel. | 18 ACCEPT_AND_OPTION, // The prompt will always check an option (if any) |
| 19 // and accept. |
| 20 CANCEL, // The prompt will always cancel. |
19 }; | 21 }; |
20 | 22 |
21 explicit ScopedTestDialogAutoConfirm(AutoConfirm override_value); | 23 explicit ScopedTestDialogAutoConfirm(AutoConfirm override_value); |
22 ~ScopedTestDialogAutoConfirm(); | 24 ~ScopedTestDialogAutoConfirm(); |
23 | 25 |
24 static AutoConfirm GetAutoConfirmValue(); | 26 static AutoConfirm GetAutoConfirmValue(); |
25 | 27 |
26 private: | 28 private: |
27 AutoConfirm old_value_; | 29 AutoConfirm old_value_; |
28 | 30 |
29 DISALLOW_COPY_AND_ASSIGN(ScopedTestDialogAutoConfirm); | 31 DISALLOW_COPY_AND_ASSIGN(ScopedTestDialogAutoConfirm); |
30 }; | 32 }; |
31 | 33 |
32 } // namespace extensions | 34 } // namespace extensions |
33 | 35 |
34 #endif // EXTENSIONS_BROWSER_EXTENSION_DIALOG_AUTO_CONFIRM_H_ | 36 #endif // EXTENSIONS_BROWSER_EXTENSION_DIALOG_AUTO_CONFIRM_H_ |
OLD | NEW |