Chromium Code Reviews| 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 EXTENSIONS_BROWSER_API_NETWORKING_CAST_NETWORKING_CAST_API_H_ | |
| 6 #define EXTENSIONS_BROWSER_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 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.
| |
| 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 NETWORKINGPRIVATE_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 NETWORKINGPRIVATE_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 NETWORKINGPRIVATE_SETWIFITDLSENABLEDSTATE); | |
| 86 | |
| 87 protected: | |
| 88 ~NetworkingCastSetWifiTDLSEnabledStateFunction() override; | |
| 89 | |
| 90 // ExtensionFunction: | |
| 91 ResponseAction Run() override; | |
| 92 | |
| 93 void Success(const std::string& result); | |
| 94 void Failure(const std::string& error, | |
| 95 std::unique_ptr<base::DictionaryValue> error_data); | |
| 96 | |
| 97 private: | |
| 98 DISALLOW_COPY_AND_ASSIGN(NetworkingCastSetWifiTDLSEnabledStateFunction); | |
| 99 }; | |
| 100 | |
| 101 class NetworkingCastGetWifiTDLSStatusFunction | |
| 102 : public UIThreadExtensionFunction { | |
| 103 public: | |
| 104 NetworkingCastGetWifiTDLSStatusFunction() {} | |
| 105 DECLARE_EXTENSION_FUNCTION("networking.cast.getWifiTDLSStatus", | |
| 106 NETWORKINGPRIVATE_GETWIFITDLSSTATUS); | |
| 107 | |
| 108 protected: | |
| 109 ~NetworkingCastGetWifiTDLSStatusFunction() override; | |
| 110 | |
| 111 // ExtensionFunction: | |
| 112 ResponseAction Run() override; | |
| 113 | |
| 114 void Success(const std::string& result); | |
| 115 void Failure(const std::string& error, | |
| 116 std::unique_ptr<base::DictionaryValue> error_data); | |
| 117 | |
| 118 private: | |
| 119 DISALLOW_COPY_AND_ASSIGN(NetworkingCastGetWifiTDLSStatusFunction); | |
| 120 }; | |
| 121 | |
| 122 } // namespace extensions | |
| 123 | |
| 124 #endif // EXTENSIONS_BROWSER_API_NETWORKING_CAST_NETWORKING_CAST_API_H_ | |
| OLD | NEW |