| 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. |
| 608 void InitIPAddressCallback(const NetworkIPConfigVector& ip_configs, |
| 609 const std::string& hardware_address); |
| 607 | 610 |
| 608 // Priority value, corresponds to index in list from shill (0 = first) | 611 // Priority value, corresponds to index in list from shill (0 = first) |
| 609 int priority_order_; | 612 int priority_order_; |
| 610 | 613 |
| 611 // Set to true if the UI requested this as a new network. | 614 // Set to true if the UI requested this as a new network. |
| 612 bool added_; | 615 bool added_; |
| 613 | 616 |
| 614 // Set to true when a new connection failure occurs; cleared when observers | 617 // Set to true when a new connection failure occurs; cleared when observers |
| 615 // are notified. | 618 // are notified. |
| 616 bool notify_failure_; | 619 bool notify_failure_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 630 NetworkUIData ui_data_; | 633 NetworkUIData ui_data_; |
| 631 | 634 |
| 632 // This is the parser we use to parse messages from the native | 635 // This is the parser we use to parse messages from the native |
| 633 // network layer. | 636 // network layer. |
| 634 scoped_ptr<NetworkParser> network_parser_; | 637 scoped_ptr<NetworkParser> network_parser_; |
| 635 | 638 |
| 636 // This map stores the set of properties for the network. | 639 // This map stores the set of properties for the network. |
| 637 // Not all properties in this map are exposed via get methods. | 640 // Not all properties in this map are exposed via get methods. |
| 638 PropertyMap property_map_; | 641 PropertyMap property_map_; |
| 639 | 642 |
| 643 // Weak pointer factory for wrapping pointers to this network in callbacks. |
| 644 base::WeakPtrFactory<Network> weak_pointer_factory_; |
| 645 |
| 640 DISALLOW_COPY_AND_ASSIGN(Network); | 646 DISALLOW_COPY_AND_ASSIGN(Network); |
| 641 }; | 647 }; |
| 642 | 648 |
| 643 // Class for networks of TYPE_ETHERNET. | 649 // Class for networks of TYPE_ETHERNET. |
| 644 class EthernetNetwork : public Network { | 650 class EthernetNetwork : public Network { |
| 645 public: | 651 public: |
| 646 explicit EthernetNetwork(const std::string& service_path); | 652 explicit EthernetNetwork(const std::string& service_path); |
| 647 private: | 653 private: |
| 648 // This allows the implementation classes access to privates. | 654 // This allows the implementation classes access to privates. |
| 649 NETWORK_LIBRARY_IMPL_FRIENDS; | 655 NETWORK_LIBRARY_IMPL_FRIENDS; |
| (...skipping 551 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 |