| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_EXTENSIONS_API_CERTIFICATE_PROVIDER_CERTIFICATE_PROVIDER_
API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_CERTIFICATE_PROVIDER_CERTIFICATE_PROVIDER_
API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_CERTIFICATE_PROVIDER_CERTIFICATE_PROVIDER_
API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_CERTIFICATE_PROVIDER_CERTIFICATE_PROVIDER_
API_H_ |
| 7 | 7 |
| 8 #include "extensions/browser/extension_function.h" | 8 #include "extensions/browser/extension_function.h" |
| 9 | 9 |
| 10 namespace chromeos { | 10 namespace chromeos { |
| 11 namespace certificate_provider { | 11 namespace certificate_provider { |
| 12 struct CertificateInfo; | 12 struct CertificateInfo; |
| 13 } | 13 } |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace extensions { | 16 namespace extensions { |
| 17 | 17 |
| 18 namespace api { | 18 namespace api { |
| 19 namespace certificate_provider { | 19 namespace certificate_provider { |
| 20 // The maximum number of times per minute, extension is allowed to show PIN |
| 21 // dialog again after user closed the previous one. |
| 22 extern const int kMaxClosedDialogsPer10Mins; |
| 23 |
| 20 struct CertificateInfo; | 24 struct CertificateInfo; |
| 21 } | 25 } |
| 22 } | 26 } |
| 23 | 27 |
| 24 class CertificateProviderInternalReportCertificatesFunction | 28 class CertificateProviderInternalReportCertificatesFunction |
| 25 : public UIThreadExtensionFunction { | 29 : public UIThreadExtensionFunction { |
| 26 private: | 30 private: |
| 27 ~CertificateProviderInternalReportCertificatesFunction() override; | 31 ~CertificateProviderInternalReportCertificatesFunction() override; |
| 28 ResponseAction Run() override; | 32 ResponseAction Run() override; |
| 29 | 33 |
| 30 bool ParseCertificateInfo( | 34 bool ParseCertificateInfo( |
| 31 const api::certificate_provider::CertificateInfo& info, | 35 const api::certificate_provider::CertificateInfo& info, |
| 32 chromeos::certificate_provider::CertificateInfo* out_info); | 36 chromeos::certificate_provider::CertificateInfo* out_info); |
| 33 | 37 |
| 34 DECLARE_EXTENSION_FUNCTION("certificateProviderInternal.reportCertificates", | 38 DECLARE_EXTENSION_FUNCTION("certificateProviderInternal.reportCertificates", |
| 35 CERTIFICATEPROVIDERINTERNAL_REPORTCERTIFICATES); | 39 CERTIFICATEPROVIDERINTERNAL_REPORTCERTIFICATES); |
| 36 }; | 40 }; |
| 37 | 41 |
| 38 class CertificateProviderInternalReportSignatureFunction | 42 class CertificateProviderInternalReportSignatureFunction |
| 39 : public UIThreadExtensionFunction { | 43 : public UIThreadExtensionFunction { |
| 40 private: | 44 private: |
| 41 ~CertificateProviderInternalReportSignatureFunction() override; | 45 ~CertificateProviderInternalReportSignatureFunction() override; |
| 42 ResponseAction Run() override; | 46 ResponseAction Run() override; |
| 43 | 47 |
| 44 DECLARE_EXTENSION_FUNCTION("certificateProviderInternal.reportSignature", | 48 DECLARE_EXTENSION_FUNCTION("certificateProviderInternal.reportSignature", |
| 45 CERTIFICATEPROVIDERINTERNAL_REPORTSIGNATURE); | 49 CERTIFICATEPROVIDERINTERNAL_REPORTSIGNATURE); |
| 46 }; | 50 }; |
| 47 | 51 |
| 52 class CertificateProviderRequestPinFunction : public UIThreadExtensionFunction { |
| 53 private: |
| 54 ~CertificateProviderRequestPinFunction() override; |
| 55 ResponseAction Run() override; |
| 56 bool ShouldSkipQuotaLimiting() const override; |
| 57 void GetQuotaLimitHeuristics( |
| 58 extensions::QuotaLimitHeuristics* heuristics) const override; |
| 59 void OnInputReceived(const base::string16& value); |
| 60 |
| 61 DECLARE_EXTENSION_FUNCTION("certificateProvider.requestPin", |
| 62 CERTIFICATEPROVIDER_REQUESTPIN); |
| 63 }; |
| 64 |
| 65 class CertificateProviderStopPinRequestFunction |
| 66 : public UIThreadExtensionFunction { |
| 67 private: |
| 68 ~CertificateProviderStopPinRequestFunction() override; |
| 69 ResponseAction Run() override; |
| 70 void DialogClosed(const base::string16& value); |
| 71 |
| 72 DECLARE_EXTENSION_FUNCTION("certificateProvider.stopPinRequest", |
| 73 CERTIFICATEPROVIDER_STOPPINREQUEST); |
| 74 }; |
| 75 |
| 48 } // namespace extensions | 76 } // namespace extensions |
| 49 | 77 |
| 50 #endif // CHROME_BROWSER_EXTENSIONS_API_CERTIFICATE_PROVIDER_CERTIFICATE_PROVID
ER_API_H_ | 78 #endif // CHROME_BROWSER_EXTENSIONS_API_CERTIFICATE_PROVIDER_CERTIFICATE_PROVID
ER_API_H_ |
| OLD | NEW |