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

Side by Side Diff: chrome/browser/chromeos/cros/cros_network_functions.h

Issue 11367048: This is the first pass at making GetIPConfigs asynchronous. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_CROS_CROS_NETWORK_FUNCTIONS_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_CROS_NETWORK_FUNCTIONS_H_
6 #define CHROME_BROWSER_CHROMEOS_CROS_CROS_NETWORK_FUNCTIONS_H_ 6 #define CHROME_BROWSER_CHROMEOS_CROS_CROS_NETWORK_FUNCTIONS_H_
7 7
8 // This header is introduced to make it easy to switch from chromeos_network.cc 8 // This header is introduced to make it easy to switch from chromeos_network.cc
9 // to Chrome's own DBus code. crosbug.com/16557 9 // to Chrome's own DBus code. crosbug.com/16557
10 // All calls to functions in chromeos_network.h should be made through 10 // All calls to functions in chromeos_network.h should be made through
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 int32 msgclass; // optional; -1 if not present in message. 46 int32 msgclass; // optional; -1 if not present in message.
47 }; 47 };
48 48
49 // Callback to be called when receiving a SMS. 49 // Callback to be called when receiving a SMS.
50 typedef base::Callback<void(const std::string& modem_device_path, 50 typedef base::Callback<void(const std::string& modem_device_path,
51 const SMS& message)> MonitorSMSCallback; 51 const SMS& message)> MonitorSMSCallback;
52 52
53 // Callback for asynchronous getters. 53 // Callback for asynchronous getters.
54 typedef base::Callback<void( 54 typedef base::Callback<void(
55 const std::string& path, 55 const std::string& path,
56 const base::DictionaryValue* properties)> NetworkPropertiesCallback; 56 scoped_ptr<base::DictionaryValue> properties)> NetworkPropertiesCallback;
57 57
58 // Callback for network properties watchers. 58 // Callback for network properties watchers.
59 typedef base::Callback<void( 59 typedef base::Callback<void(
60 const std::string& path, 60 const std::string& path,
61 const std::string& key, 61 const std::string& key,
62 const base::Value& value)> NetworkPropertiesWatcherCallback; 62 const base::Value& value)> NetworkPropertiesWatcherCallback;
63 63
64 // Callback for data plan update watchers. 64 // Callback for data plan update watchers.
65 typedef base::Callback<void( 65 typedef base::Callback<void(
66 const std::string& modem_service_path, 66 const std::string& modem_service_path,
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 // automatic registration mode before initiating registration. 256 // automatic registration mode before initiating registration.
257 void CrosRequestCellularRegister(const std::string& device_path, 257 void CrosRequestCellularRegister(const std::string& device_path,
258 const std::string& network_id, 258 const std::string& network_id,
259 const NetworkOperationCallback& callback); 259 const NetworkOperationCallback& callback);
260 260
261 // Enables or disables the specific network device for connection. 261 // Enables or disables the specific network device for connection.
262 // Set offline mode. This will turn off all radios. 262 // Set offline mode. This will turn off all radios.
263 // Returns false on failure and true on success. 263 // Returns false on failure and true on success.
264 bool CrosSetOfflineMode(bool offline); 264 bool CrosSetOfflineMode(bool offline);
265 265
266 // Gets a list of all the NetworkIPConfigs using a given device path,
267 // and returns the information via callback.
268 void CrosListIPConfigs(const std::string& device_path,
269 const NetworkGetIPConfigsCallback& callback);
270
271 // DEPRECATED, DO NOT USE: Use the asynchronous CrosListIPConfigs, above,
272 // instead.
266 // Gets a list of all the NetworkIPConfigs using a given device path. 273 // Gets a list of all the NetworkIPConfigs using a given device path.
267 // Optionally, you can get ipconfig-paths and the hardware address. 274 // Optionally, you can get ipconfig-paths and the hardware address. Pass NULL as
268 // Pass NULL as |ipconfig_paths| and |hardware_address| if you are not 275 // |ipconfig_paths| and |hardware_address| if you are not interested in these
269 // interested in these values. 276 // values.
270 bool CrosListIPConfigs(const std::string& device_path, 277 bool CrosListIPConfigsAndBlock(const std::string& device_path,
271 NetworkIPConfigVector* ipconfig_vector, 278 NetworkIPConfigVector* ipconfig_vector,
272 std::vector<std::string>* ipconfig_paths, 279 std::vector<std::string>* ipconfig_paths,
273 std::string* hardware_address); 280 std::string* hardware_address);
274 281
275 // Adds a IPConfig of the given type to the device 282 // Adds a IPConfig of the given type to the device
276 bool CrosAddIPConfig(const std::string& device_path, IPConfigType type); 283 bool CrosAddIPConfig(const std::string& device_path, IPConfigType type);
277 284
278 // Removes an existing IP Config 285 // Removes an existing IP Config
279 bool CrosRemoveIPConfig(const std::string& ipconfig_path); 286 bool CrosRemoveIPConfig(const std::string& ipconfig_path);
280 287
281 // Refreshes the IP config |ipconfig_path| to pick up changes in 288 // Refreshes the IP config |ipconfig_path| to pick up changes in
282 // configuration, and renew the DHCP lease, if any. 289 // configuration, and renew the DHCP lease, if any.
283 void CrosRequestIPConfigRefresh(const std::string& ipconfig_path); 290 void CrosRequestIPConfigRefresh(const std::string& ipconfig_path);
(...skipping 19 matching lines...) Expand all
303 int32 CrosNetmaskToPrefixLength(const std::string& netmask); 310 int32 CrosNetmaskToPrefixLength(const std::string& netmask);
304 311
305 // Changes the active cellular carrier. 312 // Changes the active cellular carrier.
306 void CrosSetCarrier(const std::string& device_path, 313 void CrosSetCarrier(const std::string& device_path,
307 const std::string& carrier, 314 const std::string& carrier,
308 const NetworkOperationCallback& callback); 315 const NetworkOperationCallback& callback);
309 316
310 } // namespace chromeos 317 } // namespace chromeos
311 318
312 #endif // CHROME_BROWSER_CHROMEOS_CROS_CROS_NETWORK_FUNCTIONS_H_ 319 #endif // CHROME_BROWSER_CHROMEOS_CROS_CROS_NETWORK_FUNCTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros/cros_network_functions.cc » ('j') | chrome/browser/chromeos/cros/network_library.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698