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

Side by Side Diff: chrome/utility/wifi/wifi_service_mock.cc

Issue 27722003: Windows-specific implementation of Networking Private API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed feature platforms to 'win' and 'mac' to match Platforms from model.py Created 7 years, 1 month 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 | « chrome/utility/wifi/wifi_service.h ('k') | chrome/utility/wifi/wifi_service_test.cc » ('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 "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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 " {" 70 " {"
71 " \"ActivateOverNonCellularNetwork\": false," 71 " \"ActivateOverNonCellularNetwork\": false,"
72 " \"ActivationState\": \"not-activated\"," 72 " \"ActivationState\": \"not-activated\","
73 " \"NetworkTechnology\": \"GSM\"," 73 " \"NetworkTechnology\": \"GSM\","
74 " \"RoamingState\": \"home\"" 74 " \"RoamingState\": \"home\""
75 " }"; 75 " }";
76 networks_.push_back(network_properties); 76 networks_.push_back(network_properties);
77 } 77 }
78 } 78 }
79 79
80 virtual bool Initialize() OVERRIDE {
81 return true;
82 }
83
84 virtual void UnInitialize() OVERRIDE {}
85
80 virtual void GetProperties(const std::string& network_guid, 86 virtual void GetProperties(const std::string& network_guid,
81 const NetworkPropertiesCallback& callback, 87 const NetworkPropertiesCallback& callback,
82 const ErrorCallback& error_callback) OVERRIDE { 88 const ErrorCallback& error_callback) OVERRIDE {
83 NetworkList::iterator network_properties = FindNetwork(network_guid); 89 NetworkList::iterator network_properties = FindNetwork(network_guid);
84 if (network_properties != networks_.end()) { 90 if (network_properties != networks_.end()) {
85 callback.Run(network_guid, *network_properties); 91 callback.Run(network_guid, *network_properties);
86 } else { 92 } else {
87 scoped_ptr<base::DictionaryValue> error_data(new base::DictionaryValue); 93 scoped_ptr<base::DictionaryValue> error_data(new base::DictionaryValue);
88 error_callback.Run("Error.DBusFailed", error_data.Pass()); 94 error_callback.Run("Error.DBusFailed", error_data.Pass());
89 } 95 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 WiFiService::NetworkGuidList changed_networks(1, network_guid); 208 WiFiService::NetworkGuidList changed_networks(1, network_guid);
203 networks_changed_observer_.Run(changed_networks); 209 networks_changed_observer_.Run(changed_networks);
204 } 210 }
205 211
206 NetworkList networks_; 212 NetworkList networks_;
207 NetworkGuidListCallback networks_changed_observer_; 213 NetworkGuidListCallback networks_changed_observer_;
208 NetworkGuidListCallback network_list_changed_observer_; 214 NetworkGuidListCallback network_list_changed_observer_;
209 }; 215 };
210 216
211 WiFiService* WiFiService::CreateServiceMock() { return new WiFiServiceMock(); } 217 WiFiService* WiFiService::CreateServiceMock() { return new WiFiServiceMock(); }
218
219 // TODO(mef): Figure out a better platform switching. For now all platform
220 // except Windows use Mock implementation.
221 #if !defined(OS_WIN)
212 WiFiService* WiFiService::CreateService() { return new WiFiServiceMock(); } 222 WiFiService* WiFiService::CreateService() { return new WiFiServiceMock(); }
223 #endif
213 224
214 } // namespace wifi 225 } // namespace wifi
OLDNEW
« no previous file with comments | « chrome/utility/wifi/wifi_service.h ('k') | chrome/utility/wifi/wifi_service_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698