| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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_NETWORKING_CAST_NETWORKING_CAST_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_NETWORKING_CAST_NETWORKING_CAST_API_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <string> |
| 10 |
| 11 #include "base/macros.h" |
| 12 #include "extensions/browser/extension_function.h" |
| 13 |
| 14 namespace base { |
| 15 class DictionaryValue; |
| 16 } |
| 17 |
| 18 namespace extensions { |
| 19 |
| 20 class NetworkingCastVerifyDestinationFunction |
| 21 : public UIThreadExtensionFunction { |
| 22 public: |
| 23 NetworkingCastVerifyDestinationFunction() {} |
| 24 DECLARE_EXTENSION_FUNCTION("networking.cast.verifyDestination", |
| 25 NETWORKINGCAST_VERIFYDESTINATION); |
| 26 |
| 27 protected: |
| 28 ~NetworkingCastVerifyDestinationFunction() override; |
| 29 |
| 30 // ExtensionFunction: |
| 31 ResponseAction Run() override; |
| 32 |
| 33 void Success(bool result); |
| 34 void Failure(const std::string& error); |
| 35 |
| 36 private: |
| 37 DISALLOW_COPY_AND_ASSIGN(NetworkingCastVerifyDestinationFunction); |
| 38 }; |
| 39 |
| 40 class NetworkingCastVerifyAndEncryptCredentialsFunction |
| 41 : public UIThreadExtensionFunction { |
| 42 public: |
| 43 NetworkingCastVerifyAndEncryptCredentialsFunction() {} |
| 44 DECLARE_EXTENSION_FUNCTION("networking.cast.verifyAndEncryptCredentials", |
| 45 NETWORKINGCAST_VERIFYANDENCRYPTCREDENTIALS); |
| 46 |
| 47 protected: |
| 48 ~NetworkingCastVerifyAndEncryptCredentialsFunction() override; |
| 49 |
| 50 // ExtensionFunction: |
| 51 ResponseAction Run() override; |
| 52 |
| 53 void Success(const std::string& result); |
| 54 void Failure(const std::string& error); |
| 55 |
| 56 private: |
| 57 DISALLOW_COPY_AND_ASSIGN(NetworkingCastVerifyAndEncryptCredentialsFunction); |
| 58 }; |
| 59 |
| 60 class NetworkingCastVerifyAndEncryptDataFunction |
| 61 : public UIThreadExtensionFunction { |
| 62 public: |
| 63 NetworkingCastVerifyAndEncryptDataFunction() {} |
| 64 DECLARE_EXTENSION_FUNCTION("networking.cast.verifyAndEncryptData", |
| 65 NETWORKINGCAST_VERIFYANDENCRYPTDATA); |
| 66 |
| 67 protected: |
| 68 ~NetworkingCastVerifyAndEncryptDataFunction() override; |
| 69 |
| 70 // ExtensionFunction: |
| 71 ResponseAction Run() override; |
| 72 |
| 73 void Success(const std::string& result); |
| 74 void Failure(const std::string& error); |
| 75 |
| 76 private: |
| 77 DISALLOW_COPY_AND_ASSIGN(NetworkingCastVerifyAndEncryptDataFunction); |
| 78 }; |
| 79 |
| 80 class NetworkingCastSetWifiTDLSEnabledStateFunction |
| 81 : public UIThreadExtensionFunction { |
| 82 public: |
| 83 NetworkingCastSetWifiTDLSEnabledStateFunction() {} |
| 84 DECLARE_EXTENSION_FUNCTION("networking.cast.setWifiTDLSEnabledState", |
| 85 NETWORKINGCAST_SETWIFITDLSENABLEDSTATE); |
| 86 |
| 87 protected: |
| 88 ~NetworkingCastSetWifiTDLSEnabledStateFunction() override; |
| 89 |
| 90 // ExtensionFunction: |
| 91 ResponseAction Run() override; |
| 92 |
| 93 #if defined(OS_CHROMEOS) |
| 94 void Success(const std::string& result); |
| 95 void Failure(const std::string& error, |
| 96 std::unique_ptr<base::DictionaryValue> error_data); |
| 97 #endif |
| 98 |
| 99 private: |
| 100 DISALLOW_COPY_AND_ASSIGN(NetworkingCastSetWifiTDLSEnabledStateFunction); |
| 101 }; |
| 102 |
| 103 class NetworkingCastGetWifiTDLSStatusFunction |
| 104 : public UIThreadExtensionFunction { |
| 105 public: |
| 106 NetworkingCastGetWifiTDLSStatusFunction() {} |
| 107 DECLARE_EXTENSION_FUNCTION("networking.cast.getWifiTDLSStatus", |
| 108 NETWORKINGCAST_GETWIFITDLSSTATUS); |
| 109 |
| 110 protected: |
| 111 ~NetworkingCastGetWifiTDLSStatusFunction() override; |
| 112 |
| 113 // ExtensionFunction: |
| 114 ResponseAction Run() override; |
| 115 |
| 116 #if defined(OS_CHROMEOS) |
| 117 void Success(const std::string& result); |
| 118 void Failure(const std::string& error, |
| 119 std::unique_ptr<base::DictionaryValue> error_data); |
| 120 #endif |
| 121 |
| 122 private: |
| 123 DISALLOW_COPY_AND_ASSIGN(NetworkingCastGetWifiTDLSStatusFunction); |
| 124 }; |
| 125 |
| 126 } // namespace extensions |
| 127 |
| 128 #endif // CHROME_BROWSER_EXTENSIONS_API_NETWORKING_CAST_NETWORKING_CAST_API_H_ |
| OLD | NEW |