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.
4
5#ifndef CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_
6#define CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_
7
8#include <string>
9
10#include "base/callback.h"
11#include "ui/gfx/native_widget_types.h"
12
13namespace chrome {
14
15// An enum to describe the reason for the password request.
16enum CryptoModulePasswordReason {
17  kCryptoModulePasswordKeygen,
18  kCryptoModulePasswordCertEnrollment,
19  kCryptoModulePasswordClientAuth,
20  kCryptoModulePasswordListCerts,
21  kCryptoModulePasswordCertImport,
22  kCryptoModulePasswordCertExport,
23};
24
25typedef base::Callback<void(const std::string&)> CryptoModulePasswordCallback;
26
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.
31void ShowCryptoModulePasswordDialog(
32    const std::string& module_name,
33    bool retry,
34    CryptoModulePasswordReason reason,
35    const std::string& hostname,
36    gfx::NativeWindow parent,
37    const CryptoModulePasswordCallback& callback);
38
39}  // namespace chrome
40
41#endif  // CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_
42