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_util.h" | 5 #include "chromeos/network/network_util.h" |
6 | 6 |
7 #include "base/strings/string_tokenizer.h" | 7 #include "base/strings/string_tokenizer.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chromeos/login/login_state.h" | 10 #include "chromeos/login/login_state.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // We need to set Device[Cellular.ProviderRequiresRoaming] so that | 155 // We need to set Device[Cellular.ProviderRequiresRoaming] so that |
156 // Cellular[RoamingState] can be set correctly for badging network icons. | 156 // Cellular[RoamingState] can be set correctly for badging network icons. |
157 const DeviceState* device = | 157 const DeviceState* device = |
158 NetworkHandler::Get()->network_state_handler()->GetDeviceState( | 158 NetworkHandler::Get()->network_state_handler()->GetDeviceState( |
159 network->device_path()); | 159 network->device_path()); |
160 if (device) { | 160 if (device) { |
161 scoped_ptr<base::DictionaryValue> device_dict(new base::DictionaryValue); | 161 scoped_ptr<base::DictionaryValue> device_dict(new base::DictionaryValue); |
162 device_dict->SetBooleanWithoutPathExpansion( | 162 device_dict->SetBooleanWithoutPathExpansion( |
163 shill::kProviderRequiresRoamingProperty, | 163 shill::kProviderRequiresRoamingProperty, |
164 device->provider_requires_roaming()); | 164 device->provider_requires_roaming()); |
| 165 device_dict->SetBooleanWithoutPathExpansion( |
| 166 shill::kSupportNetworkScanProperty, device->support_network_scan()); |
165 shill_dictionary->SetWithoutPathExpansion(shill::kDeviceProperty, | 167 shill_dictionary->SetWithoutPathExpansion(shill::kDeviceProperty, |
166 device_dict.release()); | 168 device_dict.release()); |
167 } | 169 } |
168 } | 170 } |
169 | 171 |
170 // NetworkState is always associated with the primary user profile, regardless | 172 // NetworkState is always associated with the primary user profile, regardless |
171 // of what profile is associated with the page that calls this method. We do | 173 // of what profile is associated with the page that calls this method. We do |
172 // not expose any sensitive properties in the resulting dictionary, it is | 174 // not expose any sensitive properties in the resulting dictionary, it is |
173 // only used to show connection state and icons. | 175 // only used to show connection state and icons. |
174 std::string user_id_hash = chromeos::LoginState::Get()->primary_user_hash(); | 176 std::string user_id_hash = chromeos::LoginState::Get()->primary_user_hash(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 std::string TranslateShillTypeToONC(const std::string& shill_type) { | 223 std::string TranslateShillTypeToONC(const std::string& shill_type) { |
222 if (shill_type == shill::kTypeEthernet) | 224 if (shill_type == shill::kTypeEthernet) |
223 return ::onc::network_type::kEthernet; | 225 return ::onc::network_type::kEthernet; |
224 std::string onc_type; | 226 std::string onc_type; |
225 onc::TranslateStringToONC(onc::kNetworkTypeTable, shill_type, &onc_type); | 227 onc::TranslateStringToONC(onc::kNetworkTypeTable, shill_type, &onc_type); |
226 return onc_type; | 228 return onc_type; |
227 } | 229 } |
228 | 230 |
229 } // namespace network_util | 231 } // namespace network_util |
230 } // namespace chromeos | 232 } // namespace chromeos |
OLD | NEW |