OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // These classes implement the chrome.networkingPrivate JavaScript extension | 5 // These classes implement the chrome.networkingPrivate JavaScript extension |
6 // API. | 6 // API. |
7 | 7 |
8 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_H_ | 8 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_H_ |
9 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_H_ | 9 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_H_ |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 virtual bool RunImpl() OVERRIDE; | 30 virtual bool RunImpl() OVERRIDE; |
31 | 31 |
32 private: | 32 private: |
33 void GetPropertiesSuccess(const std::string& service_path, | 33 void GetPropertiesSuccess(const std::string& service_path, |
34 const base::DictionaryValue& result); | 34 const base::DictionaryValue& result); |
35 void GetPropertiesFailed(const std::string& error_name, | 35 void GetPropertiesFailed(const std::string& error_name, |
36 scoped_ptr<base::DictionaryValue> error_data); | 36 scoped_ptr<base::DictionaryValue> error_data); |
37 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetPropertiesFunction); | 37 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetPropertiesFunction); |
38 }; | 38 }; |
39 | 39 |
| 40 // Implements the chrome.networkingPrivate.getManagedProperties method. |
| 41 class NetworkingPrivateGetManagedPropertiesFunction |
| 42 : public AsyncExtensionFunction { |
| 43 public: |
| 44 NetworkingPrivateGetManagedPropertiesFunction() {} |
| 45 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getManagedProperties", |
| 46 NETWORKINGPRIVATE_GETMANAGEDPROPERTIES); |
| 47 |
| 48 protected: |
| 49 virtual ~NetworkingPrivateGetManagedPropertiesFunction(); |
| 50 |
| 51 // AsyncExtensionFunction overrides. |
| 52 virtual bool RunImpl() OVERRIDE; |
| 53 |
| 54 private: |
| 55 // Callbacks for ManagedNetworkConfigurationHandler::GetManagedProperties. |
| 56 void Success(const std::string& service_path, |
| 57 const base::DictionaryValue& result); |
| 58 void Failure(const std::string& error_name, |
| 59 scoped_ptr<base::DictionaryValue> error_data); |
| 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetManagedPropertiesFunction); |
| 62 }; |
| 63 |
40 // Implements the chrome.networkingPrivate.getState method. | 64 // Implements the chrome.networkingPrivate.getState method. |
41 class NetworkingPrivateGetStateFunction : public AsyncExtensionFunction { | 65 class NetworkingPrivateGetStateFunction : public AsyncExtensionFunction { |
42 public: | 66 public: |
43 NetworkingPrivateGetStateFunction() {} | 67 NetworkingPrivateGetStateFunction() {} |
44 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getState", | 68 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getState", |
45 NETWORKINGPRIVATE_GETSTATE); | 69 NETWORKINGPRIVATE_GETSTATE); |
46 | 70 |
47 protected: | 71 protected: |
48 virtual ~NetworkingPrivateGetStateFunction(); | 72 virtual ~NetworkingPrivateGetStateFunction(); |
49 | 73 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 virtual bool RunImpl() OVERRIDE; | 244 virtual bool RunImpl() OVERRIDE; |
221 | 245 |
222 void ResultCallback(const std::string& result); | 246 void ResultCallback(const std::string& result); |
223 void ErrorCallback(const std::string& error_name, const std::string& error); | 247 void ErrorCallback(const std::string& error_name, const std::string& error); |
224 | 248 |
225 private: | 249 private: |
226 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateVerifyAndEncryptDataFunction); | 250 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateVerifyAndEncryptDataFunction); |
227 }; | 251 }; |
228 | 252 |
229 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_H_ | 253 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_H_ |
OLD | NEW |