Chromium Code Reviews| 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 and accept. |
|
Devlin
2017/05/15 23:28:05
nit: "an option (if any)"
catmullings
2017/05/18 18:26:00
Done.
| |
| 19 CANCEL, // The prompt will always cancel. | |
| 19 }; | 20 }; |
| 20 | 21 |
| 21 explicit ScopedTestDialogAutoConfirm(AutoConfirm override_value); | 22 explicit ScopedTestDialogAutoConfirm(AutoConfirm override_value); |
| 22 ~ScopedTestDialogAutoConfirm(); | 23 ~ScopedTestDialogAutoConfirm(); |
| 23 | 24 |
| 24 static AutoConfirm GetAutoConfirmValue(); | 25 static AutoConfirm GetAutoConfirmValue(); |
| 25 | 26 |
| 26 private: | 27 private: |
| 27 AutoConfirm old_value_; | 28 AutoConfirm old_value_; |
| 28 | 29 |
| 29 DISALLOW_COPY_AND_ASSIGN(ScopedTestDialogAutoConfirm); | 30 DISALLOW_COPY_AND_ASSIGN(ScopedTestDialogAutoConfirm); |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 } // namespace extensions | 33 } // namespace extensions |
| 33 | 34 |
| 34 #endif // EXTENSIONS_BROWSER_EXTENSION_DIALOG_AUTO_CONFIRM_H_ | 35 #endif // EXTENSIONS_BROWSER_EXTENSION_DIALOG_AUTO_CONFIRM_H_ |
| OLD | NEW |