| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/arc/net/arc_net_host_impl.h" | 5 #include "components/arc/net/arc_net_host_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 base::DictionaryValue* network_dict = nullptr; | 98 base::DictionaryValue* network_dict = nullptr; |
| 99 value->GetAsDictionary(&network_dict); | 99 value->GetAsDictionary(&network_dict); |
| 100 DCHECK(network_dict); | 100 DCHECK(network_dict); |
| 101 | 101 |
| 102 // kName is a post-processed version of kHexSSID. | 102 // kName is a post-processed version of kHexSSID. |
| 103 std::string tmp; | 103 std::string tmp; |
| 104 network_dict->GetString(onc::network_config::kName, &tmp); | 104 network_dict->GetString(onc::network_config::kName, &tmp); |
| 105 DCHECK(!tmp.empty()); | 105 DCHECK(!tmp.empty()); |
| 106 wc->ssid = tmp; | 106 wc->ssid = tmp; |
| 107 | 107 |
| 108 tmp.clear(); |
| 109 network_dict->GetString(onc::network_config::kGUID, &tmp); |
| 110 DCHECK(!tmp.empty()); |
| 111 wc->guid = tmp; |
| 112 |
| 108 base::DictionaryValue* wifi_dict = nullptr; | 113 base::DictionaryValue* wifi_dict = nullptr; |
| 109 network_dict->GetDictionary(onc::network_config::kWiFi, &wifi_dict); | 114 network_dict->GetDictionary(onc::network_config::kWiFi, &wifi_dict); |
| 110 DCHECK(wifi_dict); | 115 DCHECK(wifi_dict); |
| 111 | 116 |
| 112 if (!wifi_dict->GetInteger(onc::wifi::kFrequency, &wc->frequency)) | 117 if (!wifi_dict->GetInteger(onc::wifi::kFrequency, &wc->frequency)) |
| 113 wc->frequency = 0; | 118 wc->frequency = 0; |
| 114 if (!wifi_dict->GetInteger(onc::wifi::kSignalStrength, | 119 if (!wifi_dict->GetInteger(onc::wifi::kSignalStrength, |
| 115 &wc->signal_strength)) | 120 &wc->signal_strength)) |
| 116 wc->signal_strength = 0; | 121 wc->signal_strength = 0; |
| 117 | 122 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 155 } |
| 151 | 156 |
| 152 arc_bridge_service()->net_instance()->ScanCompleted(); | 157 arc_bridge_service()->net_instance()->ScanCompleted(); |
| 153 } | 158 } |
| 154 | 159 |
| 155 void ArcNetHostImpl::OnShuttingDown() { | 160 void ArcNetHostImpl::OnShuttingDown() { |
| 156 GetStateHandler()->RemoveObserver(this, FROM_HERE); | 161 GetStateHandler()->RemoveObserver(this, FROM_HERE); |
| 157 } | 162 } |
| 158 | 163 |
| 159 } // namespace arc | 164 } // namespace arc |
| OLD | NEW |