| 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 flimflam property. |
| 584 void SetProfilePath(const std::string& profile_path); |
| 585 |
| 586 // Trigger an asynchronous initialization the IP address field. |
| 587 void InitIPAddress(); |
| 588 |
| 589 // Initialize the IP address field. |
| 590 static void InitIPAddressCallback( |
| 591 const std::string& service_path, |
| 592 const NetworkIPConfigVector& ip_configs, |
| 593 const std::string& hardware_address); |
| 594 |
| 583 std::string device_path_; | 595 std::string device_path_; |
| 584 std::string name_; | 596 std::string name_; |
| 585 std::string ip_address_; | 597 std::string ip_address_; |
| 586 ConnectionMode mode_; | 598 ConnectionMode mode_; |
| 587 ConnectionState state_; | 599 ConnectionState state_; |
| 588 ConnectionError error_; | 600 ConnectionError error_; |
| 589 bool connectable_; | 601 bool connectable_; |
| 590 bool connection_started_; | 602 bool connection_started_; |
| 591 bool is_active_; | 603 bool is_active_; |
| 592 int priority_; // determines order in network list. | 604 int priority_; // determines order in network list. |
| 593 bool auto_connect_; | 605 bool auto_connect_; |
| 594 bool save_credentials_; // save passphrase and EAP credentials to disk. | 606 bool save_credentials_; // save passphrase and EAP credentials to disk. |
| 595 std::string proxy_config_; // ProxyConfig property in shill. | 607 std::string proxy_config_; // ProxyConfig property in shill. |
| 596 ProxyOncConfig proxy_onc_config_; // Only used for parsing ONC proxy value. | 608 ProxyOncConfig proxy_onc_config_; // Only used for parsing ONC proxy value. |
| 597 scoped_ptr<EnrollmentDelegate> enrollment_delegate_; | 609 scoped_ptr<EnrollmentDelegate> enrollment_delegate_; |
| 598 | 610 |
| 599 // Unique identifier, set the first time the network is parsed. | 611 // Unique identifier, set the first time the network is parsed. |
| 600 std::string unique_id_; | 612 std::string unique_id_; |
| 601 | 613 |
| 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) | 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_; |
| 617 | 623 |
| (...skipping 583 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 |