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

Unified Diff: components/wifi/fake_wifi_service.cc

Issue 88653002: Move GetVisibleNetworks network type filtering to WiFiService interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: components/wifi/fake_wifi_service.cc
diff --git a/components/wifi/fake_wifi_service.cc b/components/wifi/fake_wifi_service.cc
index e8c2372dee09c2a44c11554058b38c3b54135856..3add5ec56027dd80145ae15f470640564dbfa513 100644
--- a/components/wifi/fake_wifi_service.cc
+++ b/components/wifi/fake_wifi_service.cc
@@ -107,12 +107,17 @@ class FakeWiFiService : public WiFiService {
}
}
- virtual void GetVisibleNetworks(ListValue* network_list) OVERRIDE {
+ virtual void GetVisibleNetworks(const std::string& network_type,
+ ListValue* network_list) OVERRIDE {
for (WiFiService::NetworkList::const_iterator it = networks_.begin();
it != networks_.end();
++it) {
- scoped_ptr<DictionaryValue> network(it->ToValue(true));
- network_list->Append(network.release());
+ if (network_type.empty() ||
+ network_type == onc::network_type::kAllTypes ||
+ network_type == it->type) {
tbarzic 2013/11/26 18:39:36 nit: I find it more natural to have the value that
mef 2013/11/26 18:59:15 Done.
+ scoped_ptr<DictionaryValue> network(it->ToValue(true));
+ network_list->Append(network.release());
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698