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 #include "chromeos/network/network_state.h" | 5 #include "chromeos/network/network_state.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "chromeos/network/network_event_log.h" | 8 #include "chromeos/network/network_event_log.h" |
9 #include "chromeos/network/network_profile_handler.h" | 9 #include "chromeos/network/network_profile_handler.h" |
10 #include "chromeos/network/network_util.h" | 10 #include "chromeos/network/network_util.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid_); | 233 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid_); |
234 dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, | 234 dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, |
235 profile_path_); | 235 profile_path_); |
236 dictionary->SetBooleanWithoutPathExpansion( | 236 dictionary->SetBooleanWithoutPathExpansion( |
237 shill::kActivateOverNonCellularNetworkProperty, | 237 shill::kActivateOverNonCellularNetworkProperty, |
238 activate_over_non_cellular_networks_); | 238 activate_over_non_cellular_networks_); |
239 dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty, | 239 dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty, |
240 cellular_out_of_credits_); | 240 cellular_out_of_credits_); |
241 } | 241 } |
242 | 242 |
| 243 bool NetworkState::RequiresActivation() const { |
| 244 return (type() == flimflam::kTypeCellular && |
| 245 activation_state() != flimflam::kActivationStateActivated && |
| 246 activation_state() != flimflam::kActivationStateUnknown); |
| 247 } |
| 248 |
243 bool NetworkState::IsConnectedState() const { | 249 bool NetworkState::IsConnectedState() const { |
244 return StateIsConnected(connection_state_); | 250 return StateIsConnected(connection_state_); |
245 } | 251 } |
246 | 252 |
247 bool NetworkState::IsConnectingState() const { | 253 bool NetworkState::IsConnectingState() const { |
248 return StateIsConnecting(connection_state_); | 254 return StateIsConnecting(connection_state_); |
249 } | 255 } |
250 | 256 |
251 bool NetworkState::IsManaged() const { | 257 bool NetworkState::IsManaged() const { |
252 return ui_data_.onc_source() == onc::ONC_SOURCE_DEVICE_POLICY || | 258 return ui_data_.onc_source() == onc::ONC_SOURCE_DEVICE_POLICY || |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 connection_state == flimflam::kStateConfiguration || | 301 connection_state == flimflam::kStateConfiguration || |
296 connection_state == flimflam::kStateCarrier); | 302 connection_state == flimflam::kStateCarrier); |
297 } | 303 } |
298 | 304 |
299 // static | 305 // static |
300 std::string NetworkState::IPConfigProperty(const char* key) { | 306 std::string NetworkState::IPConfigProperty(const char* key) { |
301 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); | 307 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); |
302 } | 308 } |
303 | 309 |
304 } // namespace chromeos | 310 } // namespace chromeos |
OLD | NEW |