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

Side by Side Diff: chrome/browser/chromeos/extensions/networking_private_api.h

Issue 12541007: This adds the setProperties and getState functions to the networking API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed flag usage Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 12 matching lines...) Expand all
23 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getProperties", 23 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getProperties",
24 NETWORKINGPRIVATE_GETPROPERTIES); 24 NETWORKINGPRIVATE_GETPROPERTIES);
25 25
26 protected: 26 protected:
27 virtual ~NetworkingPrivateGetPropertiesFunction(); 27 virtual ~NetworkingPrivateGetPropertiesFunction();
28 28
29 // AsyncExtensionFunction overrides. 29 // AsyncExtensionFunction overrides.
30 virtual bool RunImpl() OVERRIDE; 30 virtual bool RunImpl() OVERRIDE;
31 31
32 private: 32 private:
33 // Callbacks if talking to ManagedNetworkConfigurationHandler.
34 void GetPropertiesSuccess(const std::string& service_path, 33 void GetPropertiesSuccess(const std::string& service_path,
35 const base::DictionaryValue& result); 34 const base::DictionaryValue& result);
36 void GetPropertiesFailed(const std::string& error_name, 35 void GetPropertiesFailed(const std::string& error_name,
37 scoped_ptr<base::DictionaryValue> error_data); 36 scoped_ptr<base::DictionaryValue> error_data);
38 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetPropertiesFunction); 37 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetPropertiesFunction);
39 }; 38 };
40 39
40 // Implements the chrome.networkingPrivate.getProperties method.
41 class NetworkingPrivateGetStateFunction : public AsyncExtensionFunction {
stevenjb 2013/03/07 00:43:22 NetworkingPrivateGetPropertiesFunction?
Greg Spencer (Chromium) 2013/03/07 22:01:23 No, the comment is wrong. Fixed.
42 public:
43 NetworkingPrivateGetStateFunction() {}
44 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getState",
45 NETWORKINGPRIVATE_GETSTATE);
46
47 protected:
48 virtual ~NetworkingPrivateGetStateFunction();
49
50 // AsyncExtensionFunction overrides.
51 virtual bool RunImpl() OVERRIDE;
52
53 private:
54 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetStateFunction);
55 };
56
57 // Implements the chrome.networkingPrivate.setProperties method.
58 class NetworkingPrivateSetPropertiesFunction : public AsyncExtensionFunction {
59 public:
60 NetworkingPrivateSetPropertiesFunction() {}
61 DECLARE_EXTENSION_FUNCTION("networkingPrivate.setProperties",
62 NETWORKINGPRIVATE_SETPROPERTIES);
63
64 protected:
65 virtual ~NetworkingPrivateSetPropertiesFunction();
66
67 // AsyncExtensionFunction overrides.
68 virtual bool RunImpl() OVERRIDE;
69
70 private:
71 void ErrorCallback(const std::string& error_name,
72 const scoped_ptr<base::DictionaryValue> error_data);
73 void ResultCallback();
74 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateSetPropertiesFunction);
75 };
76
41 // Implements the chrome.networkingPrivate.getVisibleNetworks method. 77 // Implements the chrome.networkingPrivate.getVisibleNetworks method.
42 class NetworkingPrivateGetVisibleNetworksFunction 78 class NetworkingPrivateGetVisibleNetworksFunction
43 : public SyncExtensionFunction { 79 : public SyncExtensionFunction {
44 public: 80 public:
45 NetworkingPrivateGetVisibleNetworksFunction() {} 81 NetworkingPrivateGetVisibleNetworksFunction() {}
46 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getVisibleNetworks", 82 DECLARE_EXTENSION_FUNCTION("networkingPrivate.getVisibleNetworks",
47 NETWORKINGPRIVATE_GETVISIBLENETWORKS); 83 NETWORKINGPRIVATE_GETVISIBLENETWORKS);
48 84
49 protected: 85 protected:
50 virtual ~NetworkingPrivateGetVisibleNetworksFunction(); 86 virtual ~NetworkingPrivateGetVisibleNetworksFunction();
51 87
52 // SyncExtensionFunction overrides. 88 // SyncExtensionFunction overrides.
53 virtual bool RunImpl() OVERRIDE; 89 virtual bool RunImpl() OVERRIDE;
54 90
55 private: 91 private:
56 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetVisibleNetworksFunction); 92 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateGetVisibleNetworksFunction);
57 }; 93 };
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 virtual bool RunImpl() OVERRIDE; 201 virtual bool RunImpl() OVERRIDE;
166 202
167 void ResultCallback(const std::string& result); 203 void ResultCallback(const std::string& result);
168 void ErrorCallback(const std::string& error_name, const std::string& error); 204 void ErrorCallback(const std::string& error_name, const std::string& error);
169 205
170 private: 206 private:
171 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateVerifyAndEncryptDataFunction); 207 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateVerifyAndEncryptDataFunction);
172 }; 208 };
173 209
174 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_H_ 210 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698