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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 17 matching lines...) Expand all Loading... |
28 // call NetworkStateHandler::GetNetworkState(path) to retrieve the state for | 28 // call NetworkStateHandler::GetNetworkState(path) to retrieve the state for |
29 // the network. | 29 // the network. |
30 // | 30 // |
31 // Note: NetworkStateHandler will store an entry for each member of | 31 // Note: NetworkStateHandler will store an entry for each member of |
32 // Manager.ServiceCompleteList. The visible() method indicates whether the | 32 // Manager.ServiceCompleteList. The visible() method indicates whether the |
33 // network is visible, and the IsInProfile() method indicates whether the | 33 // network is visible, and the IsInProfile() method indicates whether the |
34 // network is saved in a profile. | 34 // network is saved in a profile. |
35 class CHROMEOS_EXPORT NetworkState : public ManagedState { | 35 class CHROMEOS_EXPORT NetworkState : public ManagedState { |
36 public: | 36 public: |
37 explicit NetworkState(const std::string& path); | 37 explicit NetworkState(const std::string& path); |
38 virtual ~NetworkState(); | 38 ~NetworkState() override; |
39 | 39 |
40 // ManagedState overrides | 40 // ManagedState overrides |
41 // If you change this method, update GetProperties too. | 41 // If you change this method, update GetProperties too. |
42 virtual bool PropertyChanged(const std::string& key, | 42 bool PropertyChanged(const std::string& key, |
43 const base::Value& value) override; | 43 const base::Value& value) override; |
44 virtual bool InitialPropertiesReceived( | 44 bool InitialPropertiesReceived( |
45 const base::DictionaryValue& properties) override; | 45 const base::DictionaryValue& properties) override; |
46 virtual void GetStateProperties( | 46 void GetStateProperties(base::DictionaryValue* dictionary) const override; |
47 base::DictionaryValue* dictionary) const override; | |
48 | 47 |
49 void IPConfigPropertiesChanged(const base::DictionaryValue& properties); | 48 void IPConfigPropertiesChanged(const base::DictionaryValue& properties); |
50 | 49 |
51 // Returns true, if the network requires a service activation. | 50 // Returns true, if the network requires a service activation. |
52 bool RequiresActivation() const; | 51 bool RequiresActivation() const; |
53 | 52 |
54 // Accessors | 53 // Accessors |
55 bool visible() const { return visible_; } | 54 bool visible() const { return visible_; } |
56 const std::string& security() const { return security_; } | 55 const std::string& security() const { return security_; } |
57 const std::string& device_path() const { return device_path_; } | 56 const std::string& device_path() const { return device_path_; } |
(...skipping 28 matching lines...) Expand all Loading... |
86 // Cellular property accessors | 85 // Cellular property accessors |
87 const std::string& network_technology() const { | 86 const std::string& network_technology() const { |
88 return network_technology_; | 87 return network_technology_; |
89 } | 88 } |
90 const std::string& activation_type() const { return activation_type_; } | 89 const std::string& activation_type() const { return activation_type_; } |
91 const std::string& activation_state() const { return activation_state_; } | 90 const std::string& activation_state() const { return activation_state_; } |
92 const std::string& roaming() const { return roaming_; } | 91 const std::string& roaming() const { return roaming_; } |
93 const std::string& payment_url() const { return payment_url_; } | 92 const std::string& payment_url() const { return payment_url_; } |
94 bool cellular_out_of_credits() const { return cellular_out_of_credits_; } | 93 bool cellular_out_of_credits() const { return cellular_out_of_credits_; } |
95 | 94 |
96 // Whether this network has a CACertNSS nickname set. | |
97 bool HasCACertNSS() const { return has_ca_cert_nss_; } | |
98 | |
99 // Returns true if |connection_state_| is a connected/connecting state. | 95 // Returns true if |connection_state_| is a connected/connecting state. |
100 bool IsConnectedState() const; | 96 bool IsConnectedState() const; |
101 bool IsConnectingState() const; | 97 bool IsConnectingState() const; |
102 | 98 |
103 // Returns true if this is a network stored in a profile. | 99 // Returns true if this is a network stored in a profile. |
104 bool IsInProfile() const; | 100 bool IsInProfile() const; |
105 | 101 |
106 // Returns true if the network properties are stored in a user profile. | 102 // Returns true if the network properties are stored in a user profile. |
107 bool IsPrivate() const; | 103 bool IsPrivate() const; |
108 | 104 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 int signal_strength_; | 166 int signal_strength_; |
171 | 167 |
172 // Cellular properties, used for icons, Connect, and Activation. | 168 // Cellular properties, used for icons, Connect, and Activation. |
173 std::string network_technology_; | 169 std::string network_technology_; |
174 std::string activation_type_; | 170 std::string activation_type_; |
175 std::string activation_state_; | 171 std::string activation_state_; |
176 std::string roaming_; | 172 std::string roaming_; |
177 std::string payment_url_; | 173 std::string payment_url_; |
178 bool cellular_out_of_credits_; | 174 bool cellular_out_of_credits_; |
179 | 175 |
180 // Whether a deprecated CaCertNSS property of this network is set. Required | |
181 // for migration to PEM. | |
182 bool has_ca_cert_nss_; | |
183 | |
184 // TODO(pneubeck): Remove this once (Managed)NetworkConfigurationHandler | 176 // TODO(pneubeck): Remove this once (Managed)NetworkConfigurationHandler |
185 // provides proxy configuration. crbug.com/241775 | 177 // provides proxy configuration. crbug.com/241775 |
186 base::DictionaryValue proxy_config_; | 178 base::DictionaryValue proxy_config_; |
187 | 179 |
188 DISALLOW_COPY_AND_ASSIGN(NetworkState); | 180 DISALLOW_COPY_AND_ASSIGN(NetworkState); |
189 }; | 181 }; |
190 | 182 |
191 } // namespace chromeos | 183 } // namespace chromeos |
192 | 184 |
193 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ | 185 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ |
OLD | NEW |