| 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/stringprintf.h" | 7 #include "base/stringprintf.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "third_party/cros_system_api/dbus/service_constants.h" | 9 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } else if (key == flimflam::kFavoriteProperty) { | 68 } else if (key == flimflam::kFavoriteProperty) { |
| 69 return GetBooleanValue(key, value, &favorite_); | 69 return GetBooleanValue(key, value, &favorite_); |
| 70 } else if (key == flimflam::kPriorityProperty) { | 70 } else if (key == flimflam::kPriorityProperty) { |
| 71 return GetIntegerValue(key, value, &priority_); | 71 return GetIntegerValue(key, value, &priority_); |
| 72 } else if (key == flimflam::kNetworkTechnologyProperty) { | 72 } else if (key == flimflam::kNetworkTechnologyProperty) { |
| 73 return GetStringValue(key, value, &technology_); | 73 return GetStringValue(key, value, &technology_); |
| 74 } else if (key == flimflam::kDeviceProperty) { | 74 } else if (key == flimflam::kDeviceProperty) { |
| 75 return GetStringValue(key, value, &device_path_); | 75 return GetStringValue(key, value, &device_path_); |
| 76 } else if (key == flimflam::kGuidProperty) { | 76 } else if (key == flimflam::kGuidProperty) { |
| 77 return GetStringValue(key, value, &guid_); | 77 return GetStringValue(key, value, &guid_); |
| 78 } else if (key == flimflam::kProfileProperty) { |
| 79 return GetStringValue(key, value, &profile_path_); |
| 78 } else if (key == shill::kActivateOverNonCellularNetworkProperty) { | 80 } else if (key == shill::kActivateOverNonCellularNetworkProperty) { |
| 79 return GetBooleanValue(key, value, &activate_over_non_cellular_networks_); | 81 return GetBooleanValue(key, value, &activate_over_non_cellular_networks_); |
| 80 } else if (key == shill::kOutOfCreditsProperty) { | 82 } else if (key == shill::kOutOfCreditsProperty) { |
| 81 return GetBooleanValue(key, value, &cellular_out_of_credits_); | 83 return GetBooleanValue(key, value, &cellular_out_of_credits_); |
| 82 } | 84 } |
| 83 return false; | 85 return false; |
| 84 } | 86 } |
| 85 | 87 |
| 86 void NetworkState::GetProperties(base::DictionaryValue* dictionary) const { | 88 void NetworkState::GetProperties(base::DictionaryValue* dictionary) const { |
| 87 // Keep care that these properties are the same as in |PropertyChanged|. | 89 // Keep care that these properties are the same as in |PropertyChanged|. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 114 dictionary->SetBooleanWithoutPathExpansion(flimflam::kFavoriteProperty, | 116 dictionary->SetBooleanWithoutPathExpansion(flimflam::kFavoriteProperty, |
| 115 favorite()); | 117 favorite()); |
| 116 dictionary->SetIntegerWithoutPathExpansion(flimflam::kPriorityProperty, | 118 dictionary->SetIntegerWithoutPathExpansion(flimflam::kPriorityProperty, |
| 117 priority()); | 119 priority()); |
| 118 dictionary->SetStringWithoutPathExpansion( | 120 dictionary->SetStringWithoutPathExpansion( |
| 119 flimflam::kNetworkTechnologyProperty, | 121 flimflam::kNetworkTechnologyProperty, |
| 120 technology()); | 122 technology()); |
| 121 dictionary->SetStringWithoutPathExpansion(flimflam::kDeviceProperty, | 123 dictionary->SetStringWithoutPathExpansion(flimflam::kDeviceProperty, |
| 122 device_path()); | 124 device_path()); |
| 123 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid()); | 125 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid()); |
| 126 dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty, |
| 127 profile_path()); |
| 124 dictionary->SetBooleanWithoutPathExpansion( | 128 dictionary->SetBooleanWithoutPathExpansion( |
| 125 shill::kActivateOverNonCellularNetworkProperty, | 129 shill::kActivateOverNonCellularNetworkProperty, |
| 126 activate_over_non_cellular_networks()); | 130 activate_over_non_cellular_networks()); |
| 127 dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty, | 131 dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty, |
| 128 cellular_out_of_credits()); | 132 cellular_out_of_credits()); |
| 129 } | 133 } |
| 130 | 134 |
| 131 bool NetworkState::IsConnectedState() const { | 135 bool NetworkState::IsConnectedState() const { |
| 132 return StateIsConnected(connection_state_); | 136 return StateIsConnected(connection_state_); |
| 133 } | 137 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 149 connection_state == flimflam::kStateConfiguration || | 153 connection_state == flimflam::kStateConfiguration || |
| 150 connection_state == flimflam::kStateCarrier); | 154 connection_state == flimflam::kStateCarrier); |
| 151 } | 155 } |
| 152 | 156 |
| 153 // static | 157 // static |
| 154 std::string NetworkState::IPConfigProperty(const char* key) { | 158 std::string NetworkState::IPConfigProperty(const char* key) { |
| 155 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); | 159 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); |
| 156 } | 160 } |
| 157 | 161 |
| 158 } // namespace chromeos | 162 } // namespace chromeos |
| OLD | NEW |