| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_ |
| 6 #define CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_ | 6 #define CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace crypto { |
| 16 class CryptoModuleBlockingPasswordDelegate; | 16 class CryptoModuleBlockingPasswordDelegate; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 class CryptoModule; | 20 class CryptoModule; |
| 21 typedef std::vector<scoped_refptr<CryptoModule> > CryptoModuleList; | 21 typedef std::vector<scoped_refptr<CryptoModule> > CryptoModuleList; |
| 22 class X509Certificate; | 22 class X509Certificate; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace browser { | 25 namespace browser { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 41 // affects the message displayed in the dialog. |server| is the name | 41 // affects the message displayed in the dialog. |server| is the name |
| 42 // of the server which requested the access. | 42 // of the server which requested the access. |
| 43 void ShowCryptoModulePasswordDialog(const std::string& module_name, | 43 void ShowCryptoModulePasswordDialog(const std::string& module_name, |
| 44 bool retry, | 44 bool retry, |
| 45 CryptoModulePasswordReason reason, | 45 CryptoModulePasswordReason reason, |
| 46 const std::string& server, | 46 const std::string& server, |
| 47 CryptoModulePasswordCallback* callback); | 47 CryptoModulePasswordCallback* callback); |
| 48 | 48 |
| 49 // Returns a CryptoModuleBlockingPasswordDelegate to open a dialog and block | 49 // Returns a CryptoModuleBlockingPasswordDelegate to open a dialog and block |
| 50 // until returning. Should only be used on a worker thread. | 50 // until returning. Should only be used on a worker thread. |
| 51 base::CryptoModuleBlockingPasswordDelegate* | 51 crypto::CryptoModuleBlockingPasswordDelegate* |
| 52 NewCryptoModuleBlockingDialogDelegate( | 52 NewCryptoModuleBlockingDialogDelegate( |
| 53 CryptoModulePasswordReason reason, | 53 CryptoModulePasswordReason reason, |
| 54 const std::string& server); | 54 const std::string& server); |
| 55 | 55 |
| 56 // Asynchronously unlock |modules|, if necessary. |callback| is called when | 56 // Asynchronously unlock |modules|, if necessary. |callback| is called when |
| 57 // done (regardless if any modules were successfully unlocked or not). Should | 57 // done (regardless if any modules were successfully unlocked or not). Should |
| 58 // only be called on UI thread. | 58 // only be called on UI thread. |
| 59 void UnlockSlotsIfNecessary(const net::CryptoModuleList& modules, | 59 void UnlockSlotsIfNecessary(const net::CryptoModuleList& modules, |
| 60 browser::CryptoModulePasswordReason reason, | 60 browser::CryptoModulePasswordReason reason, |
| 61 const std::string& server, | 61 const std::string& server, |
| 62 Callback0::Type* callback); | 62 Callback0::Type* callback); |
| 63 | 63 |
| 64 // Asynchronously unlock the |cert|'s module, if necessary. |callback| is | 64 // Asynchronously unlock the |cert|'s module, if necessary. |callback| is |
| 65 // called when done (regardless if module was successfully unlocked or not). | 65 // called when done (regardless if module was successfully unlocked or not). |
| 66 // Should only be called on UI thread. | 66 // Should only be called on UI thread. |
| 67 void UnlockCertSlotIfNecessary(net::X509Certificate* cert, | 67 void UnlockCertSlotIfNecessary(net::X509Certificate* cert, |
| 68 browser::CryptoModulePasswordReason reason, | 68 browser::CryptoModulePasswordReason reason, |
| 69 const std::string& server, | 69 const std::string& server, |
| 70 Callback0::Type* callback); | 70 Callback0::Type* callback); |
| 71 | 71 |
| 72 } // namespace browser | 72 } // namespace browser |
| 73 | 73 |
| 74 #endif // CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_ | 74 #endif // CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_H_ |
| OLD | NEW |