| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DELEGATE_NSS_H_ | 5 #ifndef CHROME_BROWSER_UI_CRYPTO_MODULE_DELEGATE_NSS_H_ |
| 6 #define CHROME_BROWSER_UI_CRYPTO_MODULE_DELEGATE_NSS_H_ | 6 #define CHROME_BROWSER_UI_CRYPTO_MODULE_DELEGATE_NSS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // Must be called on IO thread. Returns true if the delegate is ready for use. | 34 // Must be called on IO thread. Returns true if the delegate is ready for use. |
| 35 // Otherwise, if |initialization_complete_callback| is non-null, the | 35 // Otherwise, if |initialization_complete_callback| is non-null, the |
| 36 // initialization will proceed asynchronously and the callback will be run | 36 // initialization will proceed asynchronously and the callback will be run |
| 37 // once the delegate is ready to use. In that case, the caller must ensure the | 37 // once the delegate is ready to use. In that case, the caller must ensure the |
| 38 // delegate remains alive until the callback is run. | 38 // delegate remains alive until the callback is run. |
| 39 bool InitializeSlot(content::ResourceContext* context, | 39 bool InitializeSlot(content::ResourceContext* context, |
| 40 const base::Closure& initialization_complete_callback) | 40 const base::Closure& initialization_complete_callback) |
| 41 WARN_UNUSED_RESULT; | 41 WARN_UNUSED_RESULT; |
| 42 | 42 |
| 43 // crypto::NSSCryptoModuleDelegate implementation. | 43 // crypto::NSSCryptoModuleDelegate implementation. |
| 44 virtual crypto::ScopedPK11Slot RequestSlot() OVERRIDE; | 44 virtual crypto::ScopedPK11Slot RequestSlot() override; |
| 45 | 45 |
| 46 // crypto::CryptoModuleBlockingPasswordDelegate implementation. | 46 // crypto::CryptoModuleBlockingPasswordDelegate implementation. |
| 47 virtual std::string RequestPassword(const std::string& slot_name, | 47 virtual std::string RequestPassword(const std::string& slot_name, |
| 48 bool retry, | 48 bool retry, |
| 49 bool* cancelled) OVERRIDE; | 49 bool* cancelled) override; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 void ShowDialog(const std::string& slot_name, bool retry); | 52 void ShowDialog(const std::string& slot_name, bool retry); |
| 53 | 53 |
| 54 void GotPassword(const std::string& password); | 54 void GotPassword(const std::string& password); |
| 55 | 55 |
| 56 void DidGetSlot(const base::Closure& callback, crypto::ScopedPK11Slot slot); | 56 void DidGetSlot(const base::Closure& callback, crypto::ScopedPK11Slot slot); |
| 57 | 57 |
| 58 // Parameters displayed in the dialog. | 58 // Parameters displayed in the dialog. |
| 59 const chrome::CryptoModulePasswordReason reason_; | 59 const chrome::CryptoModulePasswordReason reason_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 72 DISALLOW_COPY_AND_ASSIGN(ChromeNSSCryptoModuleDelegate); | 72 DISALLOW_COPY_AND_ASSIGN(ChromeNSSCryptoModuleDelegate); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 // Create a delegate which only handles unlocking slots. | 75 // Create a delegate which only handles unlocking slots. |
| 76 crypto::CryptoModuleBlockingPasswordDelegate* | 76 crypto::CryptoModuleBlockingPasswordDelegate* |
| 77 CreateCryptoModuleBlockingPasswordDelegate( | 77 CreateCryptoModuleBlockingPasswordDelegate( |
| 78 chrome::CryptoModulePasswordReason reason, | 78 chrome::CryptoModulePasswordReason reason, |
| 79 const net::HostPortPair& server); | 79 const net::HostPortPair& server); |
| 80 | 80 |
| 81 #endif // CHROME_BROWSER_UI_CRYPTO_MODULE_DELEGATE_NSS_H_ | 81 #endif // CHROME_BROWSER_UI_CRYPTO_MODULE_DELEGATE_NSS_H_ |
| OLD | NEW |