[email protected] | 6246ac5 | 2012-09-24 01:55:29 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 3f1f841 | 2011-01-19 03:01:23 | [diff] [blame] | 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 CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_ |
| 6 | #define CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_ |
[email protected] | 3f1f841 | 2011-01-19 03:01:23 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
[email protected] | 289838c | 2011-09-29 22:12:27 | [diff] [blame] | 10 | #include "base/callback.h" |
[email protected] | 3f1719b | 2013-11-14 00:34:54 | [diff] [blame] | 11 | #include "ui/gfx/native_widget_types.h" |
[email protected] | 3f1f841 | 2011-01-19 03:01:23 | [diff] [blame] | 12 | |
[email protected] | 3f1f841 | 2011-01-19 03:01:23 | [diff] [blame] | 13 | // An enum to describe the reason for the password request. |
| 14 | enum CryptoModulePasswordReason { |
[email protected] | 3f1f841 | 2011-01-19 03:01:23 | [diff] [blame] | 15 | kCryptoModulePasswordCertEnrollment, |
| 16 | kCryptoModulePasswordClientAuth, |
[email protected] | 4c4f7cd | 2011-03-05 02:20:44 | [diff] [blame] | 17 | kCryptoModulePasswordListCerts, |
[email protected] | 3f1f841 | 2011-01-19 03:01:23 | [diff] [blame] | 18 | kCryptoModulePasswordCertImport, |
| 19 | kCryptoModulePasswordCertExport, |
| 20 | }; |
| 21 | |
[email protected] | 99e5e952 | 2013-12-16 13:05:27 | [diff] [blame] | 22 | typedef base::Callback<void(const std::string&)> CryptoModulePasswordCallback; |
[email protected] | 3f1f841 | 2011-01-19 03:01:23 | [diff] [blame] | 23 | |
| 24 | // Display a dialog, prompting the user to authenticate to unlock |
| 25 | // |module|. |reason| describes the purpose of the authentication and |
[email protected] | 791879c | 2013-12-17 07:22:41 | [diff] [blame] | 26 | // affects the message displayed in the dialog. |hostname| is the hostname |
[email protected] | 3f1f841 | 2011-01-19 03:01:23 | [diff] [blame] | 27 | // of the server which requested the access. |
[email protected] | 6246ac5 | 2012-09-24 01:55:29 | [diff] [blame] | 28 | void ShowCryptoModulePasswordDialog( |
| 29 | const std::string& module_name, |
| 30 | bool retry, |
| 31 | CryptoModulePasswordReason reason, |
[email protected] | 791879c | 2013-12-17 07:22:41 | [diff] [blame] | 32 | const std::string& hostname, |
[email protected] | 3f1719b | 2013-11-14 00:34:54 | [diff] [blame] | 33 | gfx::NativeWindow parent, |
[email protected] | 6246ac5 | 2012-09-24 01:55:29 | [diff] [blame] | 34 | const CryptoModulePasswordCallback& callback); |
[email protected] | 3f1f841 | 2011-01-19 03:01:23 | [diff] [blame] | 35 | |
[email protected] | 3f1f841 | 2011-01-19 03:01:23 | [diff] [blame] | 36 | #endif // CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_ |