Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1960)

Unified Diff: chrome/browser/extensions/api/networking_cast_private/networking_cast_private_api.h

Issue 2726223004: Introduce networking.cast API (Closed)
Patch Set: histograms Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/networking_cast_private/networking_cast_private_api.h
diff --git a/chrome/browser/extensions/api/networking_cast_private/networking_cast_private_api.h b/chrome/browser/extensions/api/networking_cast_private/networking_cast_private_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..749e858804d19f2a7eb9417c523490425c70d3b0
--- /dev/null
+++ b/chrome/browser/extensions/api/networking_cast_private/networking_cast_private_api.h
@@ -0,0 +1,131 @@
+// 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 CHROME_BROWSER_EXTENSIONS_API_NETWORKING_CAST_PRIVATE_NETWORKING_CAST_PRIVATE_API_H_
+#define CHROME_BROWSER_EXTENSIONS_API_NETWORKING_CAST_PRIVATE_NETWORKING_CAST_PRIVATE_API_H_
+
+#include <memory>
+#include <string>
+
+#include "base/macros.h"
+#include "extensions/browser/extension_function.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace extensions {
+
+class NetworkingCastPrivateVerifyDestinationFunction
+ : public UIThreadExtensionFunction {
+ public:
+ NetworkingCastPrivateVerifyDestinationFunction() {}
+ DECLARE_EXTENSION_FUNCTION("networking.castPrivate.verifyDestination",
+ NETWORKINGCASTPRIVATE_VERIFYDESTINATION);
+
+ protected:
+ ~NetworkingCastPrivateVerifyDestinationFunction() override;
+
+ // ExtensionFunction:
+ ResponseAction Run() override;
+
+ void Success(bool result);
+ void Failure(const std::string& error);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NetworkingCastPrivateVerifyDestinationFunction);
+};
+
+class NetworkingCastPrivateVerifyAndEncryptCredentialsFunction
+ : public UIThreadExtensionFunction {
+ public:
+ NetworkingCastPrivateVerifyAndEncryptCredentialsFunction() {}
+ DECLARE_EXTENSION_FUNCTION(
+ "networking.castPrivate.verifyAndEncryptCredentials",
+ NETWORKINGCASTPRIVATE_VERIFYANDENCRYPTCREDENTIALS);
+
+ protected:
+ ~NetworkingCastPrivateVerifyAndEncryptCredentialsFunction() override;
+
+ // ExtensionFunction:
+ ResponseAction Run() override;
+
+ void Success(const std::string& result);
+ void Failure(const std::string& error);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(
+ NetworkingCastPrivateVerifyAndEncryptCredentialsFunction);
+};
+
+class NetworkingCastPrivateVerifyAndEncryptDataFunction
+ : public UIThreadExtensionFunction {
+ public:
+ NetworkingCastPrivateVerifyAndEncryptDataFunction() {}
+ DECLARE_EXTENSION_FUNCTION("networking.castPrivate.verifyAndEncryptData",
+ NETWORKINGCASTPRIVATE_VERIFYANDENCRYPTDATA);
+
+ protected:
+ ~NetworkingCastPrivateVerifyAndEncryptDataFunction() override;
+
+ // ExtensionFunction:
+ ResponseAction Run() override;
+
+ void Success(const std::string& result);
+ void Failure(const std::string& error);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NetworkingCastPrivateVerifyAndEncryptDataFunction);
+};
+
+class NetworkingCastPrivateSetWifiTDLSEnabledStateFunction
+ : public UIThreadExtensionFunction {
+ public:
+ NetworkingCastPrivateSetWifiTDLSEnabledStateFunction() {}
+ DECLARE_EXTENSION_FUNCTION("networking.castPrivate.setWifiTDLSEnabledState",
+ NETWORKINGCASTPRIVATE_SETWIFITDLSENABLEDSTATE);
+
+ protected:
+ ~NetworkingCastPrivateSetWifiTDLSEnabledStateFunction() override;
+
+ // ExtensionFunction:
+ ResponseAction Run() override;
+
+#if defined(OS_CHROMEOS)
+ void Success(const std::string& result);
+ void Failure(const std::string& error,
+ std::unique_ptr<base::DictionaryValue> error_data);
+#endif
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(
+ NetworkingCastPrivateSetWifiTDLSEnabledStateFunction);
+};
+
+class NetworkingCastPrivateGetWifiTDLSStatusFunction
+ : public UIThreadExtensionFunction {
+ public:
+ NetworkingCastPrivateGetWifiTDLSStatusFunction() {}
+ DECLARE_EXTENSION_FUNCTION("networking.castPrivate.getWifiTDLSStatus",
+ NETWORKINGCASTPRIVATE_GETWIFITDLSSTATUS);
+
+ protected:
+ ~NetworkingCastPrivateGetWifiTDLSStatusFunction() override;
+
+ // ExtensionFunction:
+ ResponseAction Run() override;
+
+#if defined(OS_CHROMEOS)
+ void Success(const std::string& result);
+ void Failure(const std::string& error,
+ std::unique_ptr<base::DictionaryValue> error_data);
+#endif
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NetworkingCastPrivateGetWifiTDLSStatusFunction);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_NETWORKING_CAST_PRIVATE_NETWORKING_CAST_PRIVATE_API_H_

Powered by Google App Engine
This is Rietveld 408576698