Chromium Code Reviews| Index: extensions/browser/extension_dialog_auto_confirm.h |
| diff --git a/extensions/browser/extension_dialog_auto_confirm.h b/extensions/browser/extension_dialog_auto_confirm.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fb5b240a6f3c04dd9640d958c952d0b7a2ce90ed |
| --- /dev/null |
| +++ b/extensions/browser/extension_dialog_auto_confirm.h |
| @@ -0,0 +1,31 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef EXTENSIONS_BROWSER_EXTENSION_DIALOG_AUTO_CONFIRM_H_ |
| +#define EXTENSIONS_BROWSER_EXTENSION_DIALOG_AUTO_CONFIRM_H_ |
| + |
| +#include "base/auto_reset.h" |
| + |
| +namespace extensions { |
| + |
| +// An enum used in for settings to cause dialogs to auto-confirm or cancel |
| +// during testing. |
| +enum ExtensionDialogAutoConfirm { |
| + AUTO_CONFIRM_NONE, // The prompt will show normally. |
| + AUTO_CONFIRM_ACCEPT, // The prompt will always accept. |
| + AUTO_CONFIRM_CANCEL, // The prompt will always cancel. |
| +}; |
| + |
| +using ScopedExtensionDialogAutoConfirm = |
|
not at google - send to devlin
2015/05/30 01:13:28
it seems like the "Extension" (and above) at least
|
| + base::AutoReset<ExtensionDialogAutoConfirm>; |
| + |
| +// Please use the above ScopedExtensionDialogAutoConfirm with these. |
| +// It'd be nice if these could go in their corresponding classes, but the |
| +// layering violation is enough of a pain that it's not worth it. |
| +extern ExtensionDialogAutoConfirm g_auto_confirm_uninstall_for_testing; |
| +extern ExtensionDialogAutoConfirm g_auto_confirm_install_for_testing; |
|
not at google - send to devlin
2015/05/30 01:13:28
I don't find the callsites of these particularly a
|
| + |
| +} // namespace extensions |
| + |
| +#endif // EXTENSIONS_BROWSER_EXTENSION_DIALOG_AUTO_CONFIRM_H_ |