Chromium Code Reviews| Index: extensions/browser/api/networking_cast/networking_cast_api.h |
| diff --git a/extensions/browser/api/networking_cast/networking_cast_api.h b/extensions/browser/api/networking_cast/networking_cast_api.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..331537f4cf8a39b7e7cbfd06612d0a8257e5a931 |
| --- /dev/null |
| +++ b/extensions/browser/api/networking_cast/networking_cast_api.h |
| @@ -0,0 +1,124 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef EXTENSIONS_BROWSER_API_NETWORKING_CAST_NETWORKING_CAST_API_H_ |
| +#define EXTENSIONS_BROWSER_API_NETWORKING_CAST_NETWORKING_CAST_API_H_ |
| + |
| +#include <memory> |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| +#include "extensions/browser/extension_function.h" |
| + |
| +namespace base { |
| +class DictionaryValue; |
| +} |
| + |
| +namespace extensions { |
| + |
| +class NetworkingCastVerifyDestinationFunction |
| + : public UIThreadExtensionFunction { |
| + public: |
| + NetworkingCastVerifyDestinationFunction() {} |
| + DECLARE_EXTENSION_FUNCTION("networking.cast.verifyDestination", |
| + NETWORKINGPRIVATE_VERIFYDESTINATION); |
|
Devlin
2017/03/13 05:21:49
I don't think we should reuse the same histograms
tbarzic
2017/03/13 22:35:01
Done.
|
| + |
| + protected: |
| + ~NetworkingCastVerifyDestinationFunction() override; |
| + |
| + // ExtensionFunction: |
| + ResponseAction Run() override; |
| + |
| + void Success(bool result); |
| + void Failure(const std::string& error); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(NetworkingCastVerifyDestinationFunction); |
| +}; |
| + |
| +class NetworkingCastVerifyAndEncryptCredentialsFunction |
| + : public UIThreadExtensionFunction { |
| + public: |
| + NetworkingCastVerifyAndEncryptCredentialsFunction() {} |
| + DECLARE_EXTENSION_FUNCTION("networking.cast.verifyAndEncryptCredentials", |
| + NETWORKINGPRIVATE_VERIFYANDENCRYPTCREDENTIALS); |
| + |
| + protected: |
| + ~NetworkingCastVerifyAndEncryptCredentialsFunction() override; |
| + |
| + // ExtensionFunction: |
| + ResponseAction Run() override; |
| + |
| + void Success(const std::string& result); |
| + void Failure(const std::string& error); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(NetworkingCastVerifyAndEncryptCredentialsFunction); |
| +}; |
| + |
| +class NetworkingCastVerifyAndEncryptDataFunction |
| + : public UIThreadExtensionFunction { |
| + public: |
| + NetworkingCastVerifyAndEncryptDataFunction() {} |
| + DECLARE_EXTENSION_FUNCTION("networking.cast.verifyAndEncryptData", |
| + NETWORKINGPRIVATE_VERIFYANDENCRYPTDATA); |
| + |
| + protected: |
| + ~NetworkingCastVerifyAndEncryptDataFunction() override; |
| + |
| + // ExtensionFunction: |
| + ResponseAction Run() override; |
| + |
| + void Success(const std::string& result); |
| + void Failure(const std::string& error); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(NetworkingCastVerifyAndEncryptDataFunction); |
| +}; |
| + |
| +class NetworkingCastSetWifiTDLSEnabledStateFunction |
| + : public UIThreadExtensionFunction { |
| + public: |
| + NetworkingCastSetWifiTDLSEnabledStateFunction() {} |
| + DECLARE_EXTENSION_FUNCTION("networking.cast.setWifiTDLSEnabledState", |
| + NETWORKINGPRIVATE_SETWIFITDLSENABLEDSTATE); |
| + |
| + protected: |
| + ~NetworkingCastSetWifiTDLSEnabledStateFunction() override; |
| + |
| + // ExtensionFunction: |
| + ResponseAction Run() override; |
| + |
| + void Success(const std::string& result); |
| + void Failure(const std::string& error, |
| + std::unique_ptr<base::DictionaryValue> error_data); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(NetworkingCastSetWifiTDLSEnabledStateFunction); |
| +}; |
| + |
| +class NetworkingCastGetWifiTDLSStatusFunction |
| + : public UIThreadExtensionFunction { |
| + public: |
| + NetworkingCastGetWifiTDLSStatusFunction() {} |
| + DECLARE_EXTENSION_FUNCTION("networking.cast.getWifiTDLSStatus", |
| + NETWORKINGPRIVATE_GETWIFITDLSSTATUS); |
| + |
| + protected: |
| + ~NetworkingCastGetWifiTDLSStatusFunction() override; |
| + |
| + // ExtensionFunction: |
| + ResponseAction Run() override; |
| + |
| + void Success(const std::string& result); |
| + void Failure(const std::string& error, |
| + std::unique_ptr<base::DictionaryValue> error_data); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(NetworkingCastGetWifiTDLSStatusFunction); |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // EXTENSIONS_BROWSER_API_NETWORKING_CAST_NETWORKING_CAST_API_H_ |