| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 ~CellularApn(); | 68 ~CellularApn(); |
| 69 void Set(const base::DictionaryValue& dict); | 69 void Set(const base::DictionaryValue& dict); |
| 70 }; | 70 }; |
| 71 typedef std::vector<CellularApn> CellularApnList; | 71 typedef std::vector<CellularApn> CellularApnList; |
| 72 | 72 |
| 73 // The value of priority if it is not set. | 73 // The value of priority if it is not set. |
| 74 const int kPriorityNotSet = 0; | 74 const int kPriorityNotSet = 0; |
| 75 // The value of priority if network is preferred. | 75 // The value of priority if network is preferred. |
| 76 const int kPriorityPreferred = 1; | 76 const int kPriorityPreferred = 1; |
| 77 | 77 |
| 78 // Contains data related to the flimflam.Device interface, | 78 // Contains data related to the shill.Device interface, |
| 79 // e.g. ethernet, wifi, cellular. | 79 // e.g. ethernet, wifi, cellular. |
| 80 // TODO(dpolukhin): refactor to make base class and device specific derivatives. | 80 // TODO(dpolukhin): refactor to make base class and device specific derivatives. |
| 81 class NetworkDevice { | 81 class NetworkDevice { |
| 82 public: | 82 public: |
| 83 explicit NetworkDevice(const std::string& device_path); | 83 explicit NetworkDevice(const std::string& device_path); |
| 84 ~NetworkDevice(); | 84 ~NetworkDevice(); |
| 85 | 85 |
| 86 NetworkDeviceParser* device_parser() { return device_parser_.get(); } | 86 NetworkDeviceParser* device_parser() { return device_parser_.get(); } |
| 87 void SetNetworkDeviceParser(NetworkDeviceParser* parser); | 87 void SetNetworkDeviceParser(NetworkDeviceParser* parser); |
| 88 | 88 |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 std::string ip_address_; | 561 std::string ip_address_; |
| 562 ConnectionMode mode_; | 562 ConnectionMode mode_; |
| 563 ConnectionState state_; | 563 ConnectionState state_; |
| 564 ConnectionError error_; | 564 ConnectionError error_; |
| 565 bool connectable_; | 565 bool connectable_; |
| 566 bool connection_started_; | 566 bool connection_started_; |
| 567 bool is_active_; | 567 bool is_active_; |
| 568 int priority_; // determines order in network list. | 568 int priority_; // determines order in network list. |
| 569 bool auto_connect_; | 569 bool auto_connect_; |
| 570 bool save_credentials_; // save passphrase and EAP credentials to disk. | 570 bool save_credentials_; // save passphrase and EAP credentials to disk. |
| 571 std::string proxy_config_; // ProxyConfig property in flimflam. | 571 std::string proxy_config_; // ProxyConfig property in shill. |
| 572 ProxyOncConfig proxy_onc_config_; // Only used for parsing ONC proxy value. | 572 ProxyOncConfig proxy_onc_config_; // Only used for parsing ONC proxy value. |
| 573 scoped_ptr<EnrollmentDelegate> enrollment_delegate_; | 573 scoped_ptr<EnrollmentDelegate> enrollment_delegate_; |
| 574 | 574 |
| 575 // Unique identifier, set the first time the network is parsed. | 575 // Unique identifier, set the first time the network is parsed. |
| 576 std::string unique_id_; | 576 std::string unique_id_; |
| 577 | 577 |
| 578 // Set the profile path and update the flimfalm property. | 578 // Set the profile path and update the flimfalm property. |
| 579 void SetProfilePath(const std::string& profile_path); | 579 void SetProfilePath(const std::string& profile_path); |
| 580 | 580 |
| 581 // Initialize the IP address field | 581 // Initialize the IP address field |
| 582 void InitIPAddress(); | 582 void InitIPAddress(); |
| 583 | 583 |
| 584 // Priority value, corresponds to index in list from flimflam (0 = first) | 584 // Priority value, corresponds to index in list from shill (0 = first) |
| 585 int priority_order_; | 585 int priority_order_; |
| 586 | 586 |
| 587 // Set to true if the UI requested this as a new network. | 587 // Set to true if the UI requested this as a new network. |
| 588 bool added_; | 588 bool added_; |
| 589 | 589 |
| 590 // Set to true when a new connection failure occurs; cleared when observers | 590 // Set to true when a new connection failure occurs; cleared when observers |
| 591 // are notified. | 591 // are notified. |
| 592 bool notify_failure_; | 592 bool notify_failure_; |
| 593 | 593 |
| 594 // Profile path for networks. | 594 // Profile path for networks. |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 const std::string& payment_url() const { return payment_url_; } | 852 const std::string& payment_url() const { return payment_url_; } |
| 853 const std::string& usage_url() const { return usage_url_; } | 853 const std::string& usage_url() const { return usage_url_; } |
| 854 const std::string& post_data() const { return post_data_; } | 854 const std::string& post_data() const { return post_data_; } |
| 855 const bool using_post() const { return using_post_; } | 855 const bool using_post() const { return using_post_; } |
| 856 DataLeft data_left() const { return data_left_; } | 856 DataLeft data_left() const { return data_left_; } |
| 857 const CellularApn& apn() const { return apn_; } | 857 const CellularApn& apn() const { return apn_; } |
| 858 const CellularApn& last_good_apn() const { return last_good_apn_; } | 858 const CellularApn& last_good_apn() const { return last_good_apn_; } |
| 859 | 859 |
| 860 // Sets the APN to use in establishing data connections. Only | 860 // Sets the APN to use in establishing data connections. Only |
| 861 // the fields of the APN that are needed for making connections | 861 // the fields of the APN that are needed for making connections |
| 862 // are passed to flimflam. The name, localized_name, and language | 862 // are passed to shill. The name, localized_name, and language |
| 863 // fields are ignored. | 863 // fields are ignored. |
| 864 void SetApn(const CellularApn& apn); | 864 void SetApn(const CellularApn& apn); |
| 865 | 865 |
| 866 // Returns true if network supports activation. | 866 // Returns true if network supports activation. |
| 867 // Current implementation returns same as SupportsDataPlan(). | 867 // Current implementation returns same as SupportsDataPlan(). |
| 868 bool SupportsActivation() const; | 868 bool SupportsActivation() const; |
| 869 | 869 |
| 870 // Returns whether the network needs to be activated. | 870 // Returns whether the network needs to be activated. |
| 871 bool NeedsActivation() const; | 871 bool NeedsActivation() const; |
| 872 | 872 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 EAPMethod eap_method_; | 1122 EAPMethod eap_method_; |
| 1123 EAPPhase2Auth eap_phase_2_auth_; | 1123 EAPPhase2Auth eap_phase_2_auth_; |
| 1124 std::string eap_server_ca_cert_nss_nickname_; | 1124 std::string eap_server_ca_cert_nss_nickname_; |
| 1125 std::string eap_client_cert_pkcs11_id_; | 1125 std::string eap_client_cert_pkcs11_id_; |
| 1126 bool eap_use_system_cas_; | 1126 bool eap_use_system_cas_; |
| 1127 std::string eap_identity_; | 1127 std::string eap_identity_; |
| 1128 std::string eap_anonymous_identity_; | 1128 std::string eap_anonymous_identity_; |
| 1129 std::string eap_passphrase_; | 1129 std::string eap_passphrase_; |
| 1130 bool eap_save_credentials_; | 1130 bool eap_save_credentials_; |
| 1131 | 1131 |
| 1132 // Internal state (not stored in flimflam). | 1132 // Internal state (not stored in shill). |
| 1133 // Passphrase set by user (stored for UI). | 1133 // Passphrase set by user (stored for UI). |
| 1134 std::string user_passphrase_; | 1134 std::string user_passphrase_; |
| 1135 | 1135 |
| 1136 // Weak pointer factory for wrapping pointers to this network in callbacks. | 1136 // Weak pointer factory for wrapping pointers to this network in callbacks. |
| 1137 base::WeakPtrFactory<WifiNetwork> weak_pointer_factory_; | 1137 base::WeakPtrFactory<WifiNetwork> weak_pointer_factory_; |
| 1138 | 1138 |
| 1139 DISALLOW_COPY_AND_ASSIGN(WifiNetwork); | 1139 DISALLOW_COPY_AND_ASSIGN(WifiNetwork); |
| 1140 }; | 1140 }; |
| 1141 | 1141 |
| 1142 typedef std::vector<WifiNetwork*> WifiNetworkVector; | 1142 typedef std::vector<WifiNetwork*> WifiNetworkVector; |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1705 const std::string& service_path) = 0; | 1705 const std::string& service_path) = 0; |
| 1706 | 1706 |
| 1707 // Factory function, creates a new instance and returns ownership. | 1707 // Factory function, creates a new instance and returns ownership. |
| 1708 // For normal usage, access the singleton via CrosLibrary::Get(). | 1708 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 1709 static NetworkLibrary* GetImpl(bool stub); | 1709 static NetworkLibrary* GetImpl(bool stub); |
| 1710 }; | 1710 }; |
| 1711 | 1711 |
| 1712 } // namespace chromeos | 1712 } // namespace chromeos |
| 1713 | 1713 |
| 1714 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 1714 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
| OLD | NEW |