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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 573 void set_ui_data(const NetworkUIData& ui_data) { | 573 void set_ui_data(const NetworkUIData& ui_data) { |
| 574 ui_data_ = ui_data; | 574 ui_data_ = ui_data; |
| 575 } | 575 } |
| 576 void set_client_cert_pattern(const CertificatePattern& pattern) { | 576 void set_client_cert_pattern(const CertificatePattern& pattern) { |
| 577 ui_data_.set_certificate_pattern(pattern); | 577 ui_data_.set_certificate_pattern(pattern); |
| 578 } | 578 } |
| 579 void set_client_cert_type(ClientCertType type) { | 579 void set_client_cert_type(ClientCertType type) { |
| 580 ui_data_.set_certificate_type(type); | 580 ui_data_.set_certificate_type(type); |
| 581 } | 581 } |
| 582 | 582 |
| 583 // Set the profile path and update the flimfalm property. | |
| 584 void SetProfilePath(const std::string& profile_path); | |
| 585 | |
| 586 // Trigger an asynchronous initialization the IP address field. | |
| 587 void InitIPAddress(); | |
|
stevenjb
2012/11/12 21:17:27
nit: blank line here
Greg Spencer (Chromium)
2012/11/12 21:39:35
Done.
| |
| 588 // Initialize the IP address field. | |
| 589 static void InitIPAddressCallback( | |
| 590 const std::string& service_path, | |
| 591 const NetworkIPConfigVector& ip_configs, | |
| 592 const std::string& hardware_address); | |
| 593 | |
| 583 std::string device_path_; | 594 std::string device_path_; |
| 584 std::string name_; | 595 std::string name_; |
| 585 std::string ip_address_; | 596 std::string ip_address_; |
| 586 ConnectionMode mode_; | 597 ConnectionMode mode_; |
| 587 ConnectionState state_; | 598 ConnectionState state_; |
| 588 ConnectionError error_; | 599 ConnectionError error_; |
| 589 bool connectable_; | 600 bool connectable_; |
| 590 bool connection_started_; | 601 bool connection_started_; |
| 591 bool is_active_; | 602 bool is_active_; |
| 592 int priority_; // determines order in network list. | 603 int priority_; // determines order in network list. |
| 593 bool auto_connect_; | 604 bool auto_connect_; |
| 594 bool save_credentials_; // save passphrase and EAP credentials to disk. | 605 bool save_credentials_; // save passphrase and EAP credentials to disk. |
| 595 std::string proxy_config_; // ProxyConfig property in shill. | 606 std::string proxy_config_; // ProxyConfig property in shill. |
| 596 ProxyOncConfig proxy_onc_config_; // Only used for parsing ONC proxy value. | 607 ProxyOncConfig proxy_onc_config_; // Only used for parsing ONC proxy value. |
| 597 scoped_ptr<EnrollmentDelegate> enrollment_delegate_; | 608 scoped_ptr<EnrollmentDelegate> enrollment_delegate_; |
| 598 | 609 |
| 599 // Unique identifier, set the first time the network is parsed. | 610 // Unique identifier, set the first time the network is parsed. |
| 600 std::string unique_id_; | 611 std::string unique_id_; |
| 601 | 612 |
| 602 // Set the profile path and update the flimfalm property. | |
| 603 void SetProfilePath(const std::string& profile_path); | |
| 604 | |
| 605 // Initialize the IP address field | |
| 606 void InitIPAddress(); | |
| 607 | |
| 608 // Priority value, corresponds to index in list from shill (0 = first) | 613 // Priority value, corresponds to index in list from shill (0 = first) |
| 609 int priority_order_; | 614 int priority_order_; |
| 610 | 615 |
| 611 // Set to true if the UI requested this as a new network. | 616 // Set to true if the UI requested this as a new network. |
| 612 bool added_; | 617 bool added_; |
| 613 | 618 |
| 614 // Set to true when a new connection failure occurs; cleared when observers | 619 // Set to true when a new connection failure occurs; cleared when observers |
| 615 // are notified. | 620 // are notified. |
| 616 bool notify_failure_; | 621 bool notify_failure_; |
| 617 | 622 |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1201 } | 1206 } |
| 1202 | 1207 |
| 1203 // Network overrides. | 1208 // Network overrides. |
| 1204 virtual void EraseCredentials() OVERRIDE; | 1209 virtual void EraseCredentials() OVERRIDE; |
| 1205 virtual void CalculateUniqueId() OVERRIDE; | 1210 virtual void CalculateUniqueId() OVERRIDE; |
| 1206 | 1211 |
| 1207 bool passphrase_required_; | 1212 bool passphrase_required_; |
| 1208 std::string eap_identity_; | 1213 std::string eap_identity_; |
| 1209 std::string eap_passphrase_; | 1214 std::string eap_passphrase_; |
| 1210 | 1215 |
| 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); | 1216 DISALLOW_COPY_AND_ASSIGN(WimaxNetwork); |
| 1215 }; | 1217 }; |
| 1216 | 1218 |
| 1217 typedef std::vector<WimaxNetwork*> WimaxNetworkVector; | 1219 typedef std::vector<WimaxNetwork*> WimaxNetworkVector; |
| 1218 | 1220 |
| 1219 // Geolocation data. | 1221 // Geolocation data. |
| 1220 struct CellTower { | 1222 struct CellTower { |
| 1221 CellTower(); | 1223 CellTower(); |
| 1222 | 1224 |
| 1223 enum RadioType { | 1225 enum RadioType { |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1684 | 1686 |
| 1685 // Enables/disables the wimax network device. | 1687 // Enables/disables the wimax network device. |
| 1686 virtual void EnableWimaxNetworkDevice(bool enable) = 0; | 1688 virtual void EnableWimaxNetworkDevice(bool enable) = 0; |
| 1687 | 1689 |
| 1688 // Enables/disables the cellular network device. | 1690 // Enables/disables the cellular network device. |
| 1689 virtual void EnableCellularNetworkDevice(bool enable) = 0; | 1691 virtual void EnableCellularNetworkDevice(bool enable) = 0; |
| 1690 | 1692 |
| 1691 // Enables/disables offline mode. | 1693 // Enables/disables offline mode. |
| 1692 virtual void EnableOfflineMode(bool enable) = 0; | 1694 virtual void EnableOfflineMode(bool enable) = 0; |
| 1693 | 1695 |
| 1694 // Fetches IP configs and hardware address for a given device_path. | 1696 // Fetches IP configs and hardware address for a given device_path and returns |
| 1695 // The hardware address is usually a MAC address like "0011AA22BB33". | 1697 // them via the given callback. |
| 1698 virtual void GetIPConfigs(const std::string& device_path, | |
| 1699 HardwareAddressFormat format, | |
| 1700 const NetworkGetIPConfigsCallback& callback) = 0; | |
| 1701 | |
| 1702 // DEPRECATED: DO NOT USE. Instead, use the asynchronous GetIPConfigs above. | |
| 1703 // Fetches IP configs and hardware address for a given device_path. The | |
| 1704 // hardware address is usually a MAC address like "0011AA22BB33". | |
| 1696 // |hardware_address| will be an empty string, if no hardware address is | 1705 // |hardware_address| will be an empty string, if no hardware address is |
| 1697 // found. | 1706 // found. |
| 1698 virtual NetworkIPConfigVector GetIPConfigs( | 1707 virtual NetworkIPConfigVector GetIPConfigsAndBlock( |
| 1699 const std::string& device_path, | 1708 const std::string& device_path, |
| 1700 std::string* hardware_address, | 1709 std::string* hardware_address, |
| 1701 HardwareAddressFormat) = 0; | 1710 HardwareAddressFormat) = 0; |
| 1702 | 1711 |
| 1703 // Sets the configuration of the IP parameters. This is called when user | 1712 // 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 | 1713 // 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. | 1714 // 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 | 1715 // |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 | 1716 // indicates which of the supplied values are overridden by values given by |
| 1708 // the default IP acquisition technique for the service (DHCP, usually). | 1717 // the default IP acquisition technique for the service (DHCP, usually). |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 1736 const std::string& service_path) = 0; | 1745 const std::string& service_path) = 0; |
| 1737 | 1746 |
| 1738 // Factory function, creates a new instance and returns ownership. | 1747 // Factory function, creates a new instance and returns ownership. |
| 1739 // For normal usage, access the singleton via CrosLibrary::Get(). | 1748 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 1740 static NetworkLibrary* GetImpl(bool stub); | 1749 static NetworkLibrary* GetImpl(bool stub); |
| 1741 }; | 1750 }; |
| 1742 | 1751 |
| 1743 } // namespace chromeos | 1752 } // namespace chromeos |
| 1744 | 1753 |
| 1745 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 1754 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| OLD | NEW |