| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_ |
| 6 #define EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_ | 6 #define EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "extensions/browser/extension_function.h" | 13 #include "extensions/browser/extension_function.h" |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 | 16 |
| 17 namespace networking_private { | 17 namespace networking_private { |
| 18 | 18 |
| 19 extern const char kErrorInvalidNetworkGuid[]; | 19 extern const char kErrorInvalidNetworkGuid[]; |
| 20 extern const char kErrorInvalidNetworkOperation[]; | 20 extern const char kErrorInvalidNetworkOperation[]; |
| 21 extern const char kErrorNetworkUnavailable[]; | 21 extern const char kErrorNetworkUnavailable[]; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 33 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getProperties", | 33 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getProperties", |
| 34 NETWORKINGPRIVATE_GETPROPERTIES); | 34 NETWORKINGPRIVATE_GETPROPERTIES); |
| 35 | 35 |
| 36 protected: | 36 protected: |
| 37 ~NetworkingPrivateGetPropertiesFunction() override; | 37 ~NetworkingPrivateGetPropertiesFunction() override; |
| 38 | 38 |
| 39 // AsyncExtensionFunction overrides. | 39 // AsyncExtensionFunction overrides. |
| 40 bool RunAsync() override; | 40 bool RunAsync() override; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 void Success(scoped_ptr<base::DictionaryValue> result); | 43 void Success(std::unique_ptr<base::DictionaryValue> result); |
| 44 void Failure(const std::string& error_name); | 44 void Failure(const std::string& error_name); |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetPropertiesFunction); | 46 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetPropertiesFunction); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 // Implements the chrome.networkingPrivate.getManagedProperties method. | 49 // Implements the chrome.networkingPrivate.getManagedProperties method. |
| 50 class NetworkingPrivateGetManagedPropertiesFunction | 50 class NetworkingPrivateGetManagedPropertiesFunction |
| 51 : public AsyncExtensionFunction { | 51 : public AsyncExtensionFunction { |
| 52 public: | 52 public: |
| 53 NetworkingPrivateGetManagedPropertiesFunction() {} | 53 NetworkingPrivateGetManagedPropertiesFunction() {} |
| 54 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getManagedProperties", | 54 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getManagedProperties", |
| 55 NETWORKINGPRIVATE_GETMANAGEDPROPERTIES); | 55 NETWORKINGPRIVATE_GETMANAGEDPROPERTIES); |
| 56 | 56 |
| 57 protected: | 57 protected: |
| 58 ~NetworkingPrivateGetManagedPropertiesFunction() override; | 58 ~NetworkingPrivateGetManagedPropertiesFunction() override; |
| 59 | 59 |
| 60 // AsyncExtensionFunction overrides. | 60 // AsyncExtensionFunction overrides. |
| 61 bool RunAsync() override; | 61 bool RunAsync() override; |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 void Success(scoped_ptr<base::DictionaryValue> result); | 64 void Success(std::unique_ptr<base::DictionaryValue> result); |
| 65 void Failure(const std::string& error); | 65 void Failure(const std::string& error); |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetManagedPropertiesFunction); | 67 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetManagedPropertiesFunction); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 // Implements the chrome.networkingPrivate.getState method. | 70 // Implements the chrome.networkingPrivate.getState method. |
| 71 class NetworkingPrivateGetStateFunction : public AsyncExtensionFunction { | 71 class NetworkingPrivateGetStateFunction : public AsyncExtensionFunction { |
| 72 public: | 72 public: |
| 73 NetworkingPrivateGetStateFunction() {} | 73 NetworkingPrivateGetStateFunction() {} |
| 74 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getState", | 74 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getState", |
| 75 NETWORKINGPRIVATE_GETSTATE); | 75 NETWORKINGPRIVATE_GETSTATE); |
| 76 | 76 |
| 77 protected: | 77 protected: |
| 78 ~NetworkingPrivateGetStateFunction() override; | 78 ~NetworkingPrivateGetStateFunction() override; |
| 79 | 79 |
| 80 // AsyncExtensionFunction overrides. | 80 // AsyncExtensionFunction overrides. |
| 81 bool RunAsync() override; | 81 bool RunAsync() override; |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 void Success(scoped_ptr<base::DictionaryValue> result); | 84 void Success(std::unique_ptr<base::DictionaryValue> result); |
| 85 void Failure(const std::string& error); | 85 void Failure(const std::string& error); |
| 86 | 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetStateFunction); | 87 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetStateFunction); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 // Implements the chrome.networkingPrivate.setProperties method. | 90 // Implements the chrome.networkingPrivate.setProperties method. |
| 91 class NetworkingPrivateSetPropertiesFunction : public AsyncExtensionFunction { | 91 class NetworkingPrivateSetPropertiesFunction : public AsyncExtensionFunction { |
| 92 public: | 92 public: |
| 93 NetworkingPrivateSetPropertiesFunction() {} | 93 NetworkingPrivateSetPropertiesFunction() {} |
| 94 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setProperties", | 94 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setProperties", |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getNetworks", | 154 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getNetworks", |
| 155 NETWORKINGPRIVATE_GETNETWORKS); | 155 NETWORKINGPRIVATE_GETNETWORKS); |
| 156 | 156 |
| 157 protected: | 157 protected: |
| 158 ~NetworkingPrivateGetNetworksFunction() override; | 158 ~NetworkingPrivateGetNetworksFunction() override; |
| 159 | 159 |
| 160 // AsyncExtensionFunction overrides. | 160 // AsyncExtensionFunction overrides. |
| 161 bool RunAsync() override; | 161 bool RunAsync() override; |
| 162 | 162 |
| 163 private: | 163 private: |
| 164 void Success(scoped_ptr<base::ListValue> network_list); | 164 void Success(std::unique_ptr<base::ListValue> network_list); |
| 165 void Failure(const std::string& error); | 165 void Failure(const std::string& error); |
| 166 | 166 |
| 167 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetNetworksFunction); | 167 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetNetworksFunction); |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 // Implements the chrome.networkingPrivate.getVisibleNetworks method. | 170 // Implements the chrome.networkingPrivate.getVisibleNetworks method. |
| 171 class NetworkingPrivateGetVisibleNetworksFunction | 171 class NetworkingPrivateGetVisibleNetworksFunction |
| 172 : public AsyncExtensionFunction { | 172 : public AsyncExtensionFunction { |
| 173 public: | 173 public: |
| 174 NetworkingPrivateGetVisibleNetworksFunction() {} | 174 NetworkingPrivateGetVisibleNetworksFunction() {} |
| 175 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getVisibleNetworks", | 175 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getVisibleNetworks", |
| 176 NETWORKINGPRIVATE_GETVISIBLENETWORKS); | 176 NETWORKINGPRIVATE_GETVISIBLENETWORKS); |
| 177 | 177 |
| 178 protected: | 178 protected: |
| 179 ~NetworkingPrivateGetVisibleNetworksFunction() override; | 179 ~NetworkingPrivateGetVisibleNetworksFunction() override; |
| 180 | 180 |
| 181 // AsyncExtensionFunction overrides. | 181 // AsyncExtensionFunction overrides. |
| 182 bool RunAsync() override; | 182 bool RunAsync() override; |
| 183 | 183 |
| 184 private: | 184 private: |
| 185 void Success(scoped_ptr<base::ListValue> network_list); | 185 void Success(std::unique_ptr<base::ListValue> network_list); |
| 186 void Failure(const std::string& error); | 186 void Failure(const std::string& error); |
| 187 | 187 |
| 188 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetVisibleNetworksFunction); | 188 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetVisibleNetworksFunction); |
| 189 }; | 189 }; |
| 190 | 190 |
| 191 // Implements the chrome.networkingPrivate.getEnabledNetworkTypes method. | 191 // Implements the chrome.networkingPrivate.getEnabledNetworkTypes method. |
| 192 class NetworkingPrivateGetEnabledNetworkTypesFunction | 192 class NetworkingPrivateGetEnabledNetworkTypesFunction |
| 193 : public SyncExtensionFunction { | 193 : public SyncExtensionFunction { |
| 194 public: | 194 public: |
| 195 NetworkingPrivateGetEnabledNetworkTypesFunction() {} | 195 NetworkingPrivateGetEnabledNetworkTypesFunction() {} |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 private: | 499 private: |
| 500 void Success(); | 500 void Success(); |
| 501 void Failure(const std::string& error); | 501 void Failure(const std::string& error); |
| 502 | 502 |
| 503 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetCellularSimStateFunction); | 503 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetCellularSimStateFunction); |
| 504 }; | 504 }; |
| 505 | 505 |
| 506 } // namespace extensions | 506 } // namespace extensions |
| 507 | 507 |
| 508 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_ | 508 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_API_H_ |
| OLD | NEW |