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