Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1137)

Side by Side Diff: chromeos/network/network_state.h

Issue 2919683002: Treat tethered networks as mobile networks (Closed)
Patch Set: Clean up code Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 // Cellular property accessors 94 // Cellular property accessors
95 const std::string& network_technology() const { 95 const std::string& network_technology() const {
96 return network_technology_; 96 return network_technology_;
97 } 97 }
98 const std::string& activation_type() const { return activation_type_; } 98 const std::string& activation_type() const { return activation_type_; }
99 const std::string& activation_state() const { return activation_state_; } 99 const std::string& activation_state() const { return activation_state_; }
100 const std::string& roaming() const { return roaming_; } 100 const std::string& roaming() const { return roaming_; }
101 const std::string& payment_url() const { return payment_url_; } 101 const std::string& payment_url() const { return payment_url_; }
102 bool cellular_out_of_credits() const { return cellular_out_of_credits_; } 102 bool cellular_out_of_credits() const { return cellular_out_of_credits_; }
103 const std::string& tethering_state() const { return tethering_state_; }
104 bool IsUsingMobileData() const;
xiyuan 2017/06/01 20:18:27 nit: This is not an accessor. Move it up ?
weidongg 2017/06/01 20:41:00 Done.
103 105
104 // VPN property accessors 106 // VPN property accessors
105 const std::string& vpn_provider_type() const { return vpn_provider_type_; } 107 const std::string& vpn_provider_type() const { return vpn_provider_type_; }
106 const std::string& third_party_vpn_provider_extension_id() const { 108 const std::string& third_party_vpn_provider_extension_id() const {
107 return third_party_vpn_provider_extension_id_; 109 return third_party_vpn_provider_extension_id_;
108 } 110 }
109 111
110 // Tether accessors and setters. 112 // Tether accessors and setters.
111 int battery_percentage() const { return battery_percentage_; } 113 int battery_percentage() const { return battery_percentage_; }
112 void set_battery_percentage(int battery_percentage) { 114 void set_battery_percentage(int battery_percentage) {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 std::string bssid_; // For ARC 221 std::string bssid_; // For ARC
220 int frequency_ = 0; // For ARC 222 int frequency_ = 0; // For ARC
221 223
222 // Cellular properties, used for icons, Connect, and Activation. 224 // Cellular properties, used for icons, Connect, and Activation.
223 std::string network_technology_; 225 std::string network_technology_;
224 std::string activation_type_; 226 std::string activation_type_;
225 std::string activation_state_; 227 std::string activation_state_;
226 std::string roaming_; 228 std::string roaming_;
227 std::string payment_url_; 229 std::string payment_url_;
228 bool cellular_out_of_credits_ = false; 230 bool cellular_out_of_credits_ = false;
231 std::string tethering_state_;
229 232
230 // VPN properties, used to construct the display name and to show the correct 233 // VPN properties, used to construct the display name and to show the correct
231 // configuration dialog. 234 // configuration dialog.
232 std::string vpn_provider_type_; 235 std::string vpn_provider_type_;
233 std::string third_party_vpn_provider_extension_id_; 236 std::string third_party_vpn_provider_extension_id_;
234 237
235 // Tether properties. 238 // Tether properties.
236 std::string carrier_; 239 std::string carrier_;
237 int battery_percentage_; 240 int battery_percentage_;
241
238 // Whether the current device has already connected to the tether host device 242 // Whether the current device has already connected to the tether host device
239 // providing the hotspot corresponding to this NetworkState. 243 // providing the hotspot corresponding to this NetworkState.
240 // Note: this means that the current device has already connected to the 244 // Note: this means that the current device has already connected to the
241 // tether host, but it does not necessarily mean that the current device has 245 // tether host, but it does not necessarily mean that the current device has
242 // connected to the Tether network corresponding to this NetworkState. 246 // connected to the Tether network corresponding to this NetworkState.
243 bool tether_has_connected_to_host_; 247 bool tether_has_connected_to_host_;
244 248
245 // TODO(pneubeck): Remove this once (Managed)NetworkConfigurationHandler 249 // TODO(pneubeck): Remove this once (Managed)NetworkConfigurationHandler
246 // provides proxy configuration. crbug.com/241775 250 // provides proxy configuration. crbug.com/241775
247 base::DictionaryValue proxy_config_; 251 base::DictionaryValue proxy_config_;
248 252
249 DISALLOW_COPY_AND_ASSIGN(NetworkState); 253 DISALLOW_COPY_AND_ASSIGN(NetworkState);
250 }; 254 };
251 255
252 } // namespace chromeos 256 } // namespace chromeos
253 257
254 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ 258 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698