Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_NETWORK_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 595 std::string proxy_config_; // ProxyConfig property in shill. | 595 std::string proxy_config_; // ProxyConfig property in shill. |
| 596 ProxyOncConfig proxy_onc_config_; // Only used for parsing ONC proxy value. | 596 ProxyOncConfig proxy_onc_config_; // Only used for parsing ONC proxy value. |
| 597 scoped_ptr<EnrollmentDelegate> enrollment_delegate_; | 597 scoped_ptr<EnrollmentDelegate> enrollment_delegate_; |
| 598 | 598 |
| 599 // Unique identifier, set the first time the network is parsed. | 599 // Unique identifier, set the first time the network is parsed. |
| 600 std::string unique_id_; | 600 std::string unique_id_; |
| 601 | 601 |
| 602 // Set the profile path and update the flimfalm property. | 602 // Set the profile path and update the flimfalm property. |
| 603 void SetProfilePath(const std::string& profile_path); | 603 void SetProfilePath(const std::string& profile_path); |
| 604 | 604 |
| 605 // Initialize the IP address field | 605 // Trigger an asynchronous initialization the IP address field. |
| 606 void InitIPAddress(); | 606 void InitIPAddress(); |
| 607 // Initialize the IP address field. Static so we can avoid a weak pointer | |
| 608 // factory in Network. | |
| 609 static void InitIPAddressCallback( | |
| 610 const std::string& device_path, | |
| 611 const NetworkIPConfigVector& ip_configs, | |
| 612 const std::string& hardware_address); | |
|
stevenjb
2012/11/12 20:40:45
Does this get used outside of the .cc file? i.e. c
Greg Spencer (Chromium)
2012/11/12 20:56:03
No, it doesn't get used outside of the .cc file, b
stevenjb
2012/11/12 21:17:27
Fair enough. I think that I regret that we used th
Greg Spencer (Chromium)
2012/11/12 21:39:35
Agreed, on both counts. We won't repeat that patt
| |
| 607 | 613 |
| 608 // Priority value, corresponds to index in list from shill (0 = first) | 614 // Priority value, corresponds to index in list from shill (0 = first) |
| 609 int priority_order_; | 615 int priority_order_; |
| 610 | 616 |
| 611 // Set to true if the UI requested this as a new network. | 617 // Set to true if the UI requested this as a new network. |
| 612 bool added_; | 618 bool added_; |
| 613 | 619 |
| 614 // Set to true when a new connection failure occurs; cleared when observers | 620 // Set to true when a new connection failure occurs; cleared when observers |
| 615 // are notified. | 621 // are notified. |
| 616 bool notify_failure_; | 622 bool notify_failure_; |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1201 } | 1207 } |
| 1202 | 1208 |
| 1203 // Network overrides. | 1209 // Network overrides. |
| 1204 virtual void EraseCredentials() OVERRIDE; | 1210 virtual void EraseCredentials() OVERRIDE; |
| 1205 virtual void CalculateUniqueId() OVERRIDE; | 1211 virtual void CalculateUniqueId() OVERRIDE; |
| 1206 | 1212 |
| 1207 bool passphrase_required_; | 1213 bool passphrase_required_; |
| 1208 std::string eap_identity_; | 1214 std::string eap_identity_; |
| 1209 std::string eap_passphrase_; | 1215 std::string eap_passphrase_; |
| 1210 | 1216 |
| 1211 // Weak pointer factory for wrapping pointers to this network in callbacks. | |
| 1212 base::WeakPtrFactory<WimaxNetwork> weak_pointer_factory_; | |
| 1213 | |
| 1214 DISALLOW_COPY_AND_ASSIGN(WimaxNetwork); | 1217 DISALLOW_COPY_AND_ASSIGN(WimaxNetwork); |
| 1215 }; | 1218 }; |
| 1216 | 1219 |
| 1217 typedef std::vector<WimaxNetwork*> WimaxNetworkVector; | 1220 typedef std::vector<WimaxNetwork*> WimaxNetworkVector; |
| 1218 | 1221 |
| 1219 // Geolocation data. | 1222 // Geolocation data. |
| 1220 struct CellTower { | 1223 struct CellTower { |
| 1221 CellTower(); | 1224 CellTower(); |
| 1222 | 1225 |
| 1223 enum RadioType { | 1226 enum RadioType { |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1684 | 1687 |
| 1685 // Enables/disables the wimax network device. | 1688 // Enables/disables the wimax network device. |
| 1686 virtual void EnableWimaxNetworkDevice(bool enable) = 0; | 1689 virtual void EnableWimaxNetworkDevice(bool enable) = 0; |
| 1687 | 1690 |
| 1688 // Enables/disables the cellular network device. | 1691 // Enables/disables the cellular network device. |
| 1689 virtual void EnableCellularNetworkDevice(bool enable) = 0; | 1692 virtual void EnableCellularNetworkDevice(bool enable) = 0; |
| 1690 | 1693 |
| 1691 // Enables/disables offline mode. | 1694 // Enables/disables offline mode. |
| 1692 virtual void EnableOfflineMode(bool enable) = 0; | 1695 virtual void EnableOfflineMode(bool enable) = 0; |
| 1693 | 1696 |
| 1694 // Fetches IP configs and hardware address for a given device_path. | 1697 // Fetches IP configs and hardware address for a given device_path and returns |
| 1695 // The hardware address is usually a MAC address like "0011AA22BB33". | 1698 // them via the given callback. |
| 1699 virtual void GetIPConfigs(const std::string& device_path, | |
| 1700 HardwareAddressFormat format, | |
| 1701 const NetworkGetIPConfigsCallback& callback) = 0; | |
| 1702 | |
| 1703 // DEPRECATED: DO NOT USE. Instead, use the asynchronous GetIPConfigs above. | |
| 1704 // Fetches IP configs and hardware address for a given device_path. The | |
| 1705 // hardware address is usually a MAC address like "0011AA22BB33". | |
| 1696 // |hardware_address| will be an empty string, if no hardware address is | 1706 // |hardware_address| will be an empty string, if no hardware address is |
| 1697 // found. | 1707 // found. |
| 1698 virtual NetworkIPConfigVector GetIPConfigs( | 1708 virtual NetworkIPConfigVector GetIPConfigsAndBlock( |
| 1699 const std::string& device_path, | 1709 const std::string& device_path, |
| 1700 std::string* hardware_address, | 1710 std::string* hardware_address, |
| 1701 HardwareAddressFormat) = 0; | 1711 HardwareAddressFormat) = 0; |
| 1702 | 1712 |
| 1703 // Sets the configuration of the IP parameters. This is called when user | 1713 // Sets the configuration of the IP parameters. This is called when user |
| 1704 // changes IP settings from dhcp to static or vice versa or when user changes | 1714 // changes IP settings from dhcp to static or vice versa or when user changes |
| 1705 // the ip config info. If nothing is changed, this method does nothing. | 1715 // the ip config info. If nothing is changed, this method does nothing. |
| 1706 // |dhcp_usage_mask| is a bitmask composed of items from the UseDHCP enum, and | 1716 // |dhcp_usage_mask| is a bitmask composed of items from the UseDHCP enum, and |
| 1707 // indicates which of the supplied values are overridden by values given by | 1717 // indicates which of the supplied values are overridden by values given by |
| 1708 // the default IP acquisition technique for the service (DHCP, usually). | 1718 // the default IP acquisition technique for the service (DHCP, usually). |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 1736 const std::string& service_path) = 0; | 1746 const std::string& service_path) = 0; |
| 1737 | 1747 |
| 1738 // Factory function, creates a new instance and returns ownership. | 1748 // Factory function, creates a new instance and returns ownership. |
| 1739 // For normal usage, access the singleton via CrosLibrary::Get(). | 1749 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 1740 static NetworkLibrary* GetImpl(bool stub); | 1750 static NetworkLibrary* GetImpl(bool stub); |
| 1741 }; | 1751 }; |
| 1742 | 1752 |
| 1743 } // namespace chromeos | 1753 } // namespace chromeos |
| 1744 | 1754 |
| 1745 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 1755 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| OLD | NEW |