Index: chrome/browser/local_discovery/wifi/wifi_client.h |
diff --git a/chrome/browser/local_discovery/wifi/wifi_client.h b/chrome/browser/local_discovery/wifi/wifi_client.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3ca43a1aa669c56207dd461fbadcae350d556444 |
--- /dev/null |
+++ b/chrome/browser/local_discovery/wifi/wifi_client.h |
@@ -0,0 +1,58 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_WIFI_CLIENT_H_ |
+#define CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_WIFI_CLIENT_H_ |
+ |
+#include <string> |
+#include <vector> |
+ |
+#include "base/callback.h" |
+#include "base/memory/scoped_ptr.h" |
+ |
+namespace local_discovery { |
+ |
+namespace wifi { |
+ |
+struct NetworkProperties { |
+ std::string internal_id; |
+ std::string ssid; |
+ bool connected; |
+}; |
+ |
+class WifiClient { |
Vitaly Buka (NO REVIEWS)
2014/05/05 22:05:58
Maybe WifiClient -> WifiManager.
"Client" is about
stevenjb
2014/05/09 18:46:15
I agree with the naming, and this class should hav
Noam Samuel
2014/05/12 23:54:12
Done.
|
+ public: |
+ typedef base::Callback<void(const std::vector<NetworkProperties>& ssids)> |
+ SSIDListCallback; |
+ typedef base::Callback<void(bool success)> SuccessCallback; |
+ typedef base::Callback< |
+ void(bool success, const std::string& ssid, const std::string& password)> |
+ CredentialsCallback; |
+ |
+ virtual ~WifiClient() {} |
+ |
+ static scoped_ptr<WifiClient> Create(); |
+ |
+ virtual void Start() = 0; |
+ |
+ virtual void GetSSIDList(const SSIDListCallback& callback) = 0; |
+ virtual void RequestScan(const SuccessCallback& callback) = 0; |
+ |
+ virtual void ConnectToNetwork(const std::string& ssid, |
+ const std::string& internal_id, |
stevenjb
2014/05/09 18:46:15
Maybe take 'NetworkProperties' instead of ssid + i
Noam Samuel
2014/05/12 23:54:12
Removed the need for network_id by adding a search
|
+ const std::string& password, |
stevenjb
2014/05/09 18:46:15
Is this API only ever going to work with PSK netwo
Noam Samuel
2014/05/12 23:54:12
Revision 1 of GCD bootstrapping is designed for PS
stevenjb
2014/05/13 00:18:06
I mention it because changing the signature of an
Noam Samuel
2014/05/13 23:51:55
Added struct.
|
+ const SuccessCallback& callback) = 0; |
+ |
+ virtual void ConnectToNetworkByID(const std::string& internal_id, |
+ const SuccessCallback& callback) = 0; |
stevenjb
2014/05/09 18:46:15
Is this designed for networks that don't require a
Noam Samuel
2014/05/12 23:54:12
This is for networks that are already configured.
|
+ |
+ virtual void GetNetworkCredentials(const std::string& internal_id, |
+ const CredentialsCallback& callback) = 0; |
+}; |
+ |
+} // namespace wifi |
+ |
+} // namespace local_discovery |
+ |
+#endif // CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_WIFI_CLIENT_H_ |