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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 virtual void GetVisibleNetworks( | 121 virtual void GetVisibleNetworks( |
122 const NetworkListCallback& callback, | 122 const NetworkListCallback& callback, |
123 const ErrorCallback& error_callback) OVERRIDE { | 123 const ErrorCallback& error_callback) OVERRIDE { |
124 callback.Run(networks_); | 124 callback.Run(networks_); |
125 } | 125 } |
126 | 126 |
127 virtual void RequestNetworkScan() OVERRIDE {} | 127 virtual void RequestNetworkScan() OVERRIDE {} |
128 | 128 |
129 virtual void StartConnect(const std::string& network_guid, | 129 virtual void StartConnect(const std::string& network_guid, |
| 130 Frequency frequency, |
130 const StringResultCallback& callback, | 131 const StringResultCallback& callback, |
131 const ErrorCallback& error_callback) OVERRIDE { | 132 const ErrorCallback& error_callback) OVERRIDE { |
132 NetworkList::iterator network_properties = FindNetwork(network_guid); | 133 NetworkList::iterator network_properties = FindNetwork(network_guid); |
133 if (network_properties != networks_.end()) { | 134 if (network_properties != networks_.end()) { |
134 DisconnectAllNetworksOfType(network_properties->type); | 135 DisconnectAllNetworksOfType(network_properties->type); |
135 network_properties->connection_state = onc::connection_state::kConnected; | 136 network_properties->connection_state = onc::connection_state::kConnected; |
136 SortNetworks(); | 137 SortNetworks(); |
137 callback.Run(network_guid); | 138 callback.Run(network_guid); |
138 NotifyNetworkListChanged(networks_); | 139 NotifyNetworkListChanged(networks_); |
139 NotifyNetworkChanged(network_guid); | 140 NotifyNetworkChanged(network_guid); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 217 |
217 WiFiService* WiFiService::CreateServiceMock() { return new WiFiServiceMock(); } | 218 WiFiService* WiFiService::CreateServiceMock() { return new WiFiServiceMock(); } |
218 | 219 |
219 // TODO(mef): Figure out a better platform switching. For now all platform | 220 // TODO(mef): Figure out a better platform switching. For now all platform |
220 // except Windows use Mock implementation. | 221 // except Windows use Mock implementation. |
221 #if !defined(OS_WIN) | 222 #if !defined(OS_WIN) |
222 WiFiService* WiFiService::CreateService() { return new WiFiServiceMock(); } | 223 WiFiService* WiFiService::CreateService() { return new WiFiServiceMock(); } |
223 #endif | 224 #endif |
224 | 225 |
225 } // namespace wifi | 226 } // namespace wifi |
OLD | NEW |