1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_
6 #define CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_
10 #include "base/callback.h"
11 #include "ui/gfx/native_widget_types.h"
15 // An enum to describe the reason for the password request.
16 enum CryptoModulePasswordReason
{
17 kCryptoModulePasswordKeygen
,
18 kCryptoModulePasswordCertEnrollment
,
19 kCryptoModulePasswordClientAuth
,
20 kCryptoModulePasswordListCerts
,
21 kCryptoModulePasswordCertImport
,
22 kCryptoModulePasswordCertExport
,
25 typedef base::Callback
<void(const std::string
&)> CryptoModulePasswordCallback
;
27 // Display a dialog, prompting the user to authenticate to unlock
28 // |module|. |reason| describes the purpose of the authentication and
29 // affects the message displayed in the dialog. |hostname| is the hostname
30 // of the server which requested the access.
31 void ShowCryptoModulePasswordDialog(
32 const std::string
& module_name
,
34 CryptoModulePasswordReason reason
,
35 const std::string
& hostname
,
36 gfx::NativeWindow parent
,
37 const CryptoModulePasswordCallback
& callback
);
41 #endif // CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_