OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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_EXTENSIONS_API_ENTERPRISE_PLATFORM_KEYS_TOKEN_METHOD_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_PLATFORM_KEYS_TOKEN_METHOD_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/macros.h" |
| 12 #include "base/callback.h" |
| 13 #include "chrome/common/extensions/api/enterprise_platform_keys.h" |
| 14 #include "chrome/common/extensions/api/enterprise_platform_keys_internal.h" |
| 15 |
| 16 class Profile; |
| 17 |
| 18 namespace extensions { |
| 19 |
| 20 class EnterprisePlatformKeysTokenMethodExtensionFunction; |
| 21 |
| 22 namespace enterprise_platform_keys_details { |
| 23 |
| 24 class TokenMethod { |
| 25 public: |
| 26 typedef base::Callback<void(const std::string& error_message)> ErrorCallback; |
| 27 |
| 28 explicit TokenMethod(const ErrorCallback& error_callback, Profile* profile); |
| 29 virtual ~TokenMethod(); |
| 30 virtual void Run() = 0; |
| 31 |
| 32 protected: |
| 33 ErrorCallback error_callback_; |
| 34 Profile* profile_; |
| 35 |
| 36 private: |
| 37 DISALLOW_COPY_AND_ASSIGN(TokenMethod); |
| 38 }; |
| 39 |
| 40 typedef base::Callback<void(const std::string& public_key_str)> |
| 41 GenerateKeyCallback; |
| 42 |
| 43 scoped_ptr<TokenMethod> CreateGenerateKey( |
| 44 scoped_ptr<api::enterprise_platform_keys_internal::GenerateKey::Params> |
| 45 params, |
| 46 const GenerateKeyCallback& callback, |
| 47 const TokenMethod::ErrorCallback& error_callback, |
| 48 Profile* profile); |
| 49 |
| 50 scoped_ptr<TokenMethod> CreateSign( |
| 51 scoped_ptr<api::enterprise_platform_keys_internal::Sign::Params> params, |
| 52 EnterprisePlatformKeysTokenMethodExtensionFunction* func); |
| 53 |
| 54 scoped_ptr<TokenMethod> CreateGetCertificates( |
| 55 scoped_ptr<api::enterprise_platform_keys::GetCertificates::Params> params, |
| 56 EnterprisePlatformKeysTokenMethodExtensionFunction* func); |
| 57 |
| 58 scoped_ptr<TokenMethod> CreateImportCertificate( |
| 59 scoped_ptr<api::enterprise_platform_keys::ImportCertificate::Params> params, |
| 60 EnterprisePlatformKeysTokenMethodExtensionFunction* func); |
| 61 |
| 62 scoped_ptr<TokenMethod> CreateRemoveCertificate( |
| 63 scoped_ptr<api::enterprise_platform_keys::RemoveCertificate::Params> params, |
| 64 EnterprisePlatformKeysTokenMethodExtensionFunction* func); |
| 65 |
| 66 } // namespace enterprise_platform_keys_details |
| 67 |
| 68 } // namespace extensions |
| 69 |
| 70 #endif // CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_PLATFORM_KEYS_TOKEN_METHOD_H
_ |
OLD | NEW |