Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1257)

Side by Side Diff: components/wifi/fake_wifi_service.cc

Issue 880143003: Add SSID getter to WiFiService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add error param Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/wifi/fake_wifi_service.h" 5 #include "components/wifi/fake_wifi_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "components/onc/onc_constants.h" 10 #include "components/onc/onc_constants.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 const NetworkGuidListCallback& networks_changed_observer, 182 const NetworkGuidListCallback& networks_changed_observer,
183 const NetworkGuidListCallback& network_list_changed_observer) { 183 const NetworkGuidListCallback& network_list_changed_observer) {
184 message_loop_proxy_.swap(message_loop_proxy); 184 message_loop_proxy_.swap(message_loop_proxy);
185 networks_changed_observer_ = networks_changed_observer; 185 networks_changed_observer_ = networks_changed_observer;
186 network_list_changed_observer_ = network_list_changed_observer; 186 network_list_changed_observer_ = network_list_changed_observer;
187 } 187 }
188 188
189 void FakeWiFiService::RequestConnectedNetworkUpdate() { 189 void FakeWiFiService::RequestConnectedNetworkUpdate() {
190 } 190 }
191 191
192 void FakeWiFiService::GetConnectedNetworkGUID(std::string* guid,
193 std::string* error) {
194 *guid = "";
195 *error = "";
196 }
197
192 NetworkList::iterator FakeWiFiService::FindNetwork( 198 NetworkList::iterator FakeWiFiService::FindNetwork(
193 const std::string& network_guid) { 199 const std::string& network_guid) {
194 for (NetworkList::iterator it = networks_.begin(); it != networks_.end(); 200 for (NetworkList::iterator it = networks_.begin(); it != networks_.end();
195 ++it) { 201 ++it) {
196 if (it->guid == network_guid) 202 if (it->guid == network_guid)
197 return it; 203 return it;
198 } 204 }
199 return networks_.end(); 205 return networks_.end();
200 } 206 }
201 207
(...skipping 22 matching lines...) Expand all
224 FROM_HERE, base::Bind(network_list_changed_observer_, current_networks)); 230 FROM_HERE, base::Bind(network_list_changed_observer_, current_networks));
225 } 231 }
226 232
227 void FakeWiFiService::NotifyNetworkChanged(const std::string& network_guid) { 233 void FakeWiFiService::NotifyNetworkChanged(const std::string& network_guid) {
228 WiFiService::NetworkGuidList changed_networks(1, network_guid); 234 WiFiService::NetworkGuidList changed_networks(1, network_guid);
229 message_loop_proxy_->PostTask( 235 message_loop_proxy_->PostTask(
230 FROM_HERE, base::Bind(networks_changed_observer_, changed_networks)); 236 FROM_HERE, base::Bind(networks_changed_observer_, changed_networks));
231 } 237 }
232 238
233 } // namespace wifi 239 } // namespace wifi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698