| 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 CHROMEOS_NETWORK_NETWORK_STATE_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_STATE_H_ |
| 6 #define CHROMEOS_NETWORK_NETWORK_STATE_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_STATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Wifi property accessors | 60 // Wifi property accessors |
| 61 bool passphrase_required() const { return passphrase_required_; } | 61 bool passphrase_required() const { return passphrase_required_; } |
| 62 // Cellular property accessors | 62 // Cellular property accessors |
| 63 const std::string& technology() const { return technology_; } | 63 const std::string& technology() const { return technology_; } |
| 64 const std::string& activation_state() const { return activation_state_; } | 64 const std::string& activation_state() const { return activation_state_; } |
| 65 const std::string& roaming() const { return roaming_; } | 65 const std::string& roaming() const { return roaming_; } |
| 66 bool activate_over_non_cellular_networks() const { | 66 bool activate_over_non_cellular_networks() const { |
| 67 return activate_over_non_cellular_networks_; | 67 return activate_over_non_cellular_networks_; |
| 68 } | 68 } |
| 69 bool cellular_out_of_credits() const { return cellular_out_of_credits_; } | 69 bool cellular_out_of_credits() const { return cellular_out_of_credits_; } |
| 70 const std::string& usage_url() const { return usage_url_; } |
| 71 const std::string& payment_url() const { return payment_url_; } |
| 72 const std::string& post_method() const { return post_method_; } |
| 73 const std::string& post_data() const { return post_data_; } |
| 70 | 74 |
| 71 bool IsConnectedState() const; | 75 bool IsConnectedState() const; |
| 72 bool IsConnectingState() const; | 76 bool IsConnectingState() const; |
| 73 | 77 |
| 74 // Returns true if |error_| contains an authentication error. | 78 // Returns true if |error_| contains an authentication error. |
| 75 bool HasAuthenticationError() const; | 79 bool HasAuthenticationError() const; |
| 76 | 80 |
| 77 // Helpers (used e.g. when a state is cached) | 81 // Helpers (used e.g. when a state is cached) |
| 78 static bool StateIsConnected(const std::string& connection_state); | 82 static bool StateIsConnected(const std::string& connection_state); |
| 79 static bool StateIsConnecting(const std::string& connection_state); | 83 static bool StateIsConnecting(const std::string& connection_state); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 90 void UpdateName(); | 94 void UpdateName(); |
| 91 | 95 |
| 92 // Called by NetworkStateHandler when the ip config changes. | 96 // Called by NetworkStateHandler when the ip config changes. |
| 93 void set_ip_address(const std::string& ip_address) { | 97 void set_ip_address(const std::string& ip_address) { |
| 94 ip_address_ = ip_address; | 98 ip_address_ = ip_address; |
| 95 } | 99 } |
| 96 void set_dns_servers(const std::vector<std::string>& dns_servers) { | 100 void set_dns_servers(const std::vector<std::string>& dns_servers) { |
| 97 dns_servers_ = dns_servers; | 101 dns_servers_ = dns_servers; |
| 98 } | 102 } |
| 99 | 103 |
| 104 // TODO(gauravsh): Audit the list of properties that we are caching. We should |
| 105 // only be doing this for commonly accessed properties. crbug.com/252553 |
| 100 // Common Network Service properties | 106 // Common Network Service properties |
| 101 std::string security_; | 107 std::string security_; |
| 102 std::string device_path_; | 108 std::string device_path_; |
| 103 std::string guid_; | 109 std::string guid_; |
| 104 std::string connection_state_; | 110 std::string connection_state_; |
| 105 std::string profile_path_; | 111 std::string profile_path_; |
| 106 std::string error_; | 112 std::string error_; |
| 107 std::string error_details_; | 113 std::string error_details_; |
| 108 bool auto_connect_; | 114 bool auto_connect_; |
| 109 bool favorite_; | 115 bool favorite_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 123 // Wifi properties | 129 // Wifi properties |
| 124 std::string hex_ssid_; | 130 std::string hex_ssid_; |
| 125 std::string country_code_; | 131 std::string country_code_; |
| 126 bool passphrase_required_; | 132 bool passphrase_required_; |
| 127 // Cellular properties | 133 // Cellular properties |
| 128 std::string technology_; | 134 std::string technology_; |
| 129 std::string activation_state_; | 135 std::string activation_state_; |
| 130 std::string roaming_; | 136 std::string roaming_; |
| 131 bool activate_over_non_cellular_networks_; | 137 bool activate_over_non_cellular_networks_; |
| 132 bool cellular_out_of_credits_; | 138 bool cellular_out_of_credits_; |
| 139 // Cellular payment portal properties. |
| 140 std::string usage_url_; |
| 141 std::string payment_url_; |
| 142 std::string post_method_; |
| 143 std::string post_data_; |
| 133 | 144 |
| 134 DISALLOW_COPY_AND_ASSIGN(NetworkState); | 145 DISALLOW_COPY_AND_ASSIGN(NetworkState); |
| 135 }; | 146 }; |
| 136 | 147 |
| 137 } // namespace chromeos | 148 } // namespace chromeos |
| 138 | 149 |
| 139 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ | 150 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ |
| OLD | NEW |