| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/chromeos/cros_network_library.h" | 5 #include "chrome/browser/chromeos/cros_network_library.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "chrome/browser/chromeos/cros_library.h" | 10 #include "chrome/browser/chromeos/cros_library.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // Notify all observers that connection has started. | 85 // Notify all observers that connection has started. |
| 86 wifi_ssid_ = network.ssid; | 86 wifi_ssid_ = network.ssid; |
| 87 wifi_connecting_ = true; | 87 wifi_connecting_ = true; |
| 88 wifi_strength_ = network.strength; | 88 wifi_strength_ = network.strength; |
| 89 FOR_EACH_OBSERVER(Observer, observers_, NetworkChanged(this)); | 89 FOR_EACH_OBSERVER(Observer, observers_, NetworkChanged(this)); |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| 93 // static | 93 // static |
| 94 void CrosNetworkLibrary::NetworkStatusChangedHandler(void* object, | 94 void CrosNetworkLibrary::NetworkStatusChangedHandler(void* object, |
| 95 const chromeos::ServiceInfo& service) { | 95 const chromeos::ServiceStatus& service_status) { |
| 96 CrosNetworkLibrary* network = static_cast<CrosNetworkLibrary*>(object); | 96 CrosNetworkLibrary* network = static_cast<CrosNetworkLibrary*>(object); |
| 97 network->ParseNetworkServiceInfo(service); | 97 for (int i = 0; i < service_status.size; i++) |
| 98 network->ParseNetworkServiceInfo(service_status.services[i]); |
| 98 FOR_EACH_OBSERVER(Observer, network->observers_, NetworkChanged(network)); | 99 FOR_EACH_OBSERVER(Observer, network->observers_, NetworkChanged(network)); |
| 99 } | 100 } |
| 100 | 101 |
| 101 void CrosNetworkLibrary::ParseNetworkServiceInfo( | 102 void CrosNetworkLibrary::ParseNetworkServiceInfo( |
| 102 const chromeos::ServiceInfo& service) { | 103 const chromeos::ServiceInfo& service) { |
| 103 DLOG(INFO) << "Parse " << service.ssid << | 104 DLOG(INFO) << "Parse " << service.ssid << |
| 104 " typ=" << service.type << | 105 " typ=" << service.type << |
| 105 " sta=" << service.state << | 106 " sta=" << service.state << |
| 106 " pas=" << service.needs_passphrase << | 107 " pas=" << service.needs_passphrase << |
| 107 " enc=" << service.encryption << | 108 " enc=" << service.encryption << |
| (...skipping 25 matching lines...) Expand all Loading... |
| 133 } | 134 } |
| 134 } | 135 } |
| 135 } | 136 } |
| 136 | 137 |
| 137 void CrosNetworkLibrary::InitNetworkStatus() { | 138 void CrosNetworkLibrary::InitNetworkStatus() { |
| 138 chromeos::ServiceStatus* service_status = chromeos::GetAvailableNetworks(); | 139 chromeos::ServiceStatus* service_status = chromeos::GetAvailableNetworks(); |
| 139 for (int i = 0; i < service_status->size; i++) | 140 for (int i = 0; i < service_status->size; i++) |
| 140 ParseNetworkServiceInfo(service_status->services[i]); | 141 ParseNetworkServiceInfo(service_status->services[i]); |
| 141 chromeos::FreeServiceStatus(service_status); | 142 chromeos::FreeServiceStatus(service_status); |
| 142 } | 143 } |
| OLD | NEW |