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

Unified Diff: chrome/browser/extensions/api/gcd_private/gcd_private_api.cc

Issue 427123002: Added function to get list of networks with prefetched passwords (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wifi_session1
Patch Set: Created 6 years, 5 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
Index: chrome/browser/extensions/api/gcd_private/gcd_private_api.cc
diff --git a/chrome/browser/extensions/api/gcd_private/gcd_private_api.cc b/chrome/browser/extensions/api/gcd_private/gcd_private_api.cc
index 48cd48adeb47b2c0eb70d1693cf07253554dd65a..2fc31f4dafd070016551102850c4b7517362c62b 100644
--- a/chrome/browser/extensions/api/gcd_private/gcd_private_api.cc
+++ b/chrome/browser/extensions/api/gcd_private/gcd_private_api.cc
@@ -351,13 +351,26 @@ void GcdPrivateAPI::StartWifiIfNotStarted() {
wifi_manager_->Start();
}
}
-
#endif
void GcdPrivateAPI::RemoveSession(int session_id) {
sessions_.erase(session_id);
}
+scoped_ptr<base::ListValue> GcdPrivateAPI::GetPrefetchedSSIDList() {
+ scoped_ptr<base::ListValue> retval(new base::ListValue);
+
+#if defined(ENABLE_WIFI_BOOTSTRAPPING)
+ for (PasswordMap::iterator i = wifi_passwords_.begin();
+ i != wifi_passwords_.end();
+ i++) {
+ retval->AppendString(i->first);
+ }
+#endif
+
+ return retval.Pass();
+}
+
// static
void GcdPrivateAPI::SetGCDApiFlowFactoryForTests(
GCDApiFlowFactoryForTests* factory) {
@@ -743,6 +756,26 @@ GcdPrivateGetCommandDefinitionsFunction::
~GcdPrivateGetCommandDefinitionsFunction() {
}
+GcdPrivateGetPrefetchedWifiNameListFunction::
+ GcdPrivateGetPrefetchedWifiNameListFunction() {
+}
+
+GcdPrivateGetPrefetchedWifiNameListFunction::
+ ~GcdPrivateGetPrefetchedWifiNameListFunction() {
+}
+
+bool GcdPrivateGetPrefetchedWifiNameListFunction::RunSync() {
+ GcdPrivateAPI* gcd_api =
+ BrowserContextKeyedAPIFactory<GcdPrivateAPI>::Get(GetProfile());
+
+ DCHECK(gcd_api);
+ scoped_ptr<base::ListValue> ssid_list = gcd_api->GetPrefetchedSSIDList();
+
+ SetResult(ssid_list.release());
+
+ return true;
+}
+
bool GcdPrivateGetCommandDefinitionsFunction::RunAsync() {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698