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

Unified Diff: chrome/utility/wifi/wifi_service_mock.cc

Issue 30753002: Move GetVisibleNetworks network type filtering to WiFiService interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address codereview comments. Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/utility/wifi/wifi_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/wifi/wifi_service_mock.cc
diff --git a/chrome/utility/wifi/wifi_service_mock.cc b/chrome/utility/wifi/wifi_service_mock.cc
index aa4bec5d3c10da299e2fdc58ec07156c554327d6..3c7257f90653c78dbb8ddc6dbaf892ce7aef7217 100644
--- a/chrome/utility/wifi/wifi_service_mock.cc
+++ b/chrome/utility/wifi/wifi_service_mock.cc
@@ -113,9 +113,20 @@ class WiFiServiceMock : public WiFiService {
}
virtual void GetVisibleNetworks(
+ const std::string& network_type,
const NetworkListCallback& callback,
const ErrorCallback& error_callback) OVERRIDE {
- callback.Run(networks_);
+ if (network_type.empty() || network_type == onc::network_type::kAllTypes) {
+ callback.Run(networks_);
+ } else {
+ NetworkList filtered_networks;
+ for (NetworkList::iterator it = networks_.begin(); it != networks_.end();
+ ++it) {
+ if (it->type == network_type)
+ filtered_networks.push_back(*it);
+ }
+ callback.Run(filtered_networks);
+ }
}
virtual void RequestNetworkScan() OVERRIDE {}
« no previous file with comments | « chrome/utility/wifi/wifi_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698