| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/utility/wifi/wifi_service.h" | 5 #include "chrome/utility/wifi/wifi_service.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "components/onc/onc_constants.h" | 7 #include "components/onc/onc_constants.h" |
| 8 | 8 |
| 9 namespace wifi { | 9 namespace wifi { |
| 10 | 10 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 virtual void GetVisibleNetworks( | 115 virtual void GetVisibleNetworks( |
| 116 const NetworkListCallback& callback, | 116 const NetworkListCallback& callback, |
| 117 const ErrorCallback& error_callback) OVERRIDE { | 117 const ErrorCallback& error_callback) OVERRIDE { |
| 118 callback.Run(networks_); | 118 callback.Run(networks_); |
| 119 } | 119 } |
| 120 | 120 |
| 121 virtual void RequestNetworkScan() OVERRIDE {} | 121 virtual void RequestNetworkScan() OVERRIDE {} |
| 122 | 122 |
| 123 virtual void StartConnect(const std::string& network_guid, | 123 virtual void StartConnect(const std::string& network_guid, |
| 124 Frequency frequency, |
| 124 const StringResultCallback& callback, | 125 const StringResultCallback& callback, |
| 125 const ErrorCallback& error_callback) OVERRIDE { | 126 const ErrorCallback& error_callback) OVERRIDE { |
| 126 NetworkList::iterator network_properties = FindNetwork(network_guid); | 127 NetworkList::iterator network_properties = FindNetwork(network_guid); |
| 127 if (network_properties != networks_.end()) { | 128 if (network_properties != networks_.end()) { |
| 128 DisconnectAllNetworksOfType(network_properties->type); | 129 DisconnectAllNetworksOfType(network_properties->type); |
| 129 network_properties->connection_state = onc::connection_state::kConnected; | 130 network_properties->connection_state = onc::connection_state::kConnected; |
| 130 SortNetworks(); | 131 SortNetworks(); |
| 131 callback.Run(network_guid); | 132 callback.Run(network_guid); |
| 132 NotifyNetworkListChanged(networks_); | 133 NotifyNetworkListChanged(networks_); |
| 133 NotifyNetworkChanged(network_guid); | 134 NotifyNetworkChanged(network_guid); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 211 |
| 211 WiFiService* WiFiService::CreateServiceMock() { return new WiFiServiceMock(); } | 212 WiFiService* WiFiService::CreateServiceMock() { return new WiFiServiceMock(); } |
| 212 | 213 |
| 213 // TODO(mef): Figure out a better platform switching. For now all platform | 214 // TODO(mef): Figure out a better platform switching. For now all platform |
| 214 // except Windows use Mock implementation. | 215 // except Windows use Mock implementation. |
| 215 #if !defined(OS_WIN) | 216 #if !defined(OS_WIN) |
| 216 WiFiService* WiFiService::CreateService() { return new WiFiServiceMock(); } | 217 WiFiService* WiFiService::CreateService() { return new WiFiServiceMock(); } |
| 217 #endif | 218 #endif |
| 218 | 219 |
| 219 } // namespace wifi | 220 } // namespace wifi |
| OLD | NEW |