Chromium Code Reviews| 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/values.h" | 7 #include "base/values.h" |
| 8 #include "third_party/cros_system_api/dbus/service_constants.h" | 8 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 9 | 9 |
| 10 namespace chromeos { | 10 namespace chromeos { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool NetworkState::IsConnectedState() const { | 46 bool NetworkState::IsConnectedState() const { |
| 47 return StateIsConnected(connection_state_); | 47 return StateIsConnected(connection_state_); |
| 48 } | 48 } |
| 49 | 49 |
| 50 bool NetworkState::IsConnectingState() const { | 50 bool NetworkState::IsConnectingState() const { |
| 51 return StateIsConnecting(connection_state_); | 51 return StateIsConnecting(connection_state_); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void NetworkState::FillDictionary(base::DictionaryValue* dictionary) const { | |
|
stevenjb
2013/03/05 17:59:18
nit: let's put this (and the header definition) ju
pneubeck (no reviews)
2013/03/07 15:53:02
Done.
| |
| 55 dictionary->SetStringWithoutPathExpansion(flimflam::kNameProperty, name()); | |
| 56 dictionary->SetStringWithoutPathExpansion(flimflam::kTypeProperty, type()); | |
| 57 dictionary->SetIntegerWithoutPathExpansion(flimflam::kSignalStrengthProperty, | |
| 58 signal_strength()); | |
|
gauravsh
2013/03/05 21:04:56
NIT: indent off?
pneubeck (no reviews)
2013/03/07 15:53:02
Done.
| |
| 59 dictionary->SetStringWithoutPathExpansion(flimflam::kStateProperty, | |
| 60 connection_state()); | |
|
gauravsh
2013/03/05 21:04:56
NIT: indent off? (and for the lines below as well)
pneubeck (no reviews)
2013/03/07 15:53:02
Done.
| |
| 61 dictionary->SetStringWithoutPathExpansion(flimflam::kErrorProperty, | |
| 62 error()); | |
| 63 dictionary->SetStringWithoutPathExpansion(flimflam::kActivationStateProperty, | |
| 64 activation_state()); | |
| 65 dictionary->SetStringWithoutPathExpansion(flimflam::kRoamingStateProperty, | |
| 66 roaming()); | |
| 67 dictionary->SetStringWithoutPathExpansion(flimflam::kSecurityProperty, | |
| 68 security()); | |
| 69 dictionary->SetStringWithoutPathExpansion( | |
| 70 flimflam::kNetworkTechnologyProperty, | |
| 71 technology()); | |
| 72 dictionary->SetStringWithoutPathExpansion(flimflam::kDeviceProperty, | |
| 73 device_path()); | |
| 74 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid()); | |
| 75 } | |
| 76 | |
| 54 // static | 77 // static |
| 55 bool NetworkState::StateIsConnected(const std::string& connection_state) { | 78 bool NetworkState::StateIsConnected(const std::string& connection_state) { |
| 56 return (connection_state == flimflam::kStateReady || | 79 return (connection_state == flimflam::kStateReady || |
| 57 connection_state == flimflam::kStateOnline || | 80 connection_state == flimflam::kStateOnline || |
| 58 connection_state == flimflam::kStatePortal); | 81 connection_state == flimflam::kStatePortal); |
| 59 } | 82 } |
| 60 | 83 |
| 61 // static | 84 // static |
| 62 bool NetworkState::StateIsConnecting(const std::string& connection_state) { | 85 bool NetworkState::StateIsConnecting(const std::string& connection_state) { |
| 63 return (connection_state == flimflam::kStateAssociation || | 86 return (connection_state == flimflam::kStateAssociation || |
| 64 connection_state == flimflam::kStateConfiguration || | 87 connection_state == flimflam::kStateConfiguration || |
| 65 connection_state == flimflam::kStateCarrier); | 88 connection_state == flimflam::kStateCarrier); |
| 66 } | 89 } |
| 67 | 90 |
| 68 } // namespace chromeos | 91 } // namespace chromeos |
| OLD | NEW |