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

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

Issue 64683014: Mac OS X-specific implementation of Networking Private API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address codereview comments. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « components/wifi.gypi ('k') | components/wifi/wifi_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/wifi_service.h" 5 #include "components/wifi/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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 networks_.push_back(network_properties); 50 networks_.push_back(network_properties);
51 } 51 }
52 { 52 {
53 WiFiService::NetworkProperties network_properties; 53 WiFiService::NetworkProperties network_properties;
54 network_properties.connection_state = 54 network_properties.connection_state =
55 onc::connection_state::kNotConnected; 55 onc::connection_state::kNotConnected;
56 network_properties.guid = "stub_wifi2"; 56 network_properties.guid = "stub_wifi2";
57 network_properties.name = "wifi2_PSK"; 57 network_properties.name = "wifi2_PSK";
58 network_properties.type = onc::network_type::kWiFi; 58 network_properties.type = onc::network_type::kWiFi;
59 network_properties.frequency = 5000; 59 network_properties.frequency = 5000;
60 network_properties.frequency_list.push_back(2400); 60 network_properties.frequency_set.insert(2400);
61 network_properties.frequency_list.push_back(5000); 61 network_properties.frequency_set.insert(5000);
62 network_properties.ssid = "wifi2_PSK"; 62 network_properties.ssid = "wifi2_PSK";
63 network_properties.security = onc::wifi::kWPA_PSK; 63 network_properties.security = onc::wifi::kWPA_PSK;
64 network_properties.signal_strength = 80; 64 network_properties.signal_strength = 80;
65 networks_.push_back(network_properties); 65 networks_.push_back(network_properties);
66 } 66 }
67 { 67 {
68 WiFiService::NetworkProperties network_properties; 68 WiFiService::NetworkProperties network_properties;
69 network_properties.connection_state = 69 network_properties.connection_state =
70 onc::connection_state::kNotConnected; 70 onc::connection_state::kNotConnected;
71 network_properties.guid = "stub_cellular1"; 71 network_properties.guid = "stub_cellular1";
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 virtual void SetEventObservers( 257 virtual void SetEventObservers(
258 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, 258 scoped_refptr<base::MessageLoopProxy> message_loop_proxy,
259 const NetworkGuidListCallback& networks_changed_observer, 259 const NetworkGuidListCallback& networks_changed_observer,
260 const NetworkGuidListCallback& network_list_changed_observer) OVERRIDE { 260 const NetworkGuidListCallback& network_list_changed_observer) OVERRIDE {
261 message_loop_proxy_.swap(message_loop_proxy); 261 message_loop_proxy_.swap(message_loop_proxy);
262 networks_changed_observer_ = networks_changed_observer; 262 networks_changed_observer_ = networks_changed_observer;
263 network_list_changed_observer_ = network_list_changed_observer; 263 network_list_changed_observer_ = network_list_changed_observer;
264 } 264 }
265 265
266 virtual void RequestConnectedNetworkUpdate() OVERRIDE { }
267
266 private: 268 private:
267 NetworkList::iterator FindNetwork(const std::string& network_guid) { 269 NetworkList::iterator FindNetwork(const std::string& network_guid) {
268 for (NetworkList::iterator it = networks_.begin(); it != networks_.end(); 270 for (NetworkList::iterator it = networks_.begin(); it != networks_.end();
269 ++it) { 271 ++it) {
270 if (it->guid == network_guid) 272 if (it->guid == network_guid)
271 return it; 273 return it;
272 } 274 }
273 return networks_.end(); 275 return networks_.end();
274 } 276 }
275 277
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 311
310 NetworkList networks_; 312 NetworkList networks_;
311 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; 313 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
312 NetworkGuidListCallback networks_changed_observer_; 314 NetworkGuidListCallback networks_changed_observer_;
313 NetworkGuidListCallback network_list_changed_observer_; 315 NetworkGuidListCallback network_list_changed_observer_;
314 }; 316 };
315 317
316 WiFiService* WiFiService::CreateForTest() { return new FakeWiFiService(); } 318 WiFiService* WiFiService::CreateForTest() { return new FakeWiFiService(); }
317 319
318 } // namespace wifi 320 } // namespace wifi
OLDNEW
« no previous file with comments | « components/wifi.gypi ('k') | components/wifi/wifi_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698