OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_WIFI_CLIENT_H_ | |
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_WIFI_CLIENT_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/callback.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 | |
14 namespace local_discovery { | |
15 | |
16 namespace wifi { | |
17 | |
18 struct NetworkProperties { | |
19 std::string internal_id; | |
20 std::string ssid; | |
21 bool connected; | |
22 }; | |
23 | |
24 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.
| |
25 public: | |
26 typedef base::Callback<void(const std::vector<NetworkProperties>& ssids)> | |
27 SSIDListCallback; | |
28 typedef base::Callback<void(bool success)> SuccessCallback; | |
29 typedef base::Callback< | |
30 void(bool success, const std::string& ssid, const std::string& password)> | |
31 CredentialsCallback; | |
32 | |
33 virtual ~WifiClient() {} | |
34 | |
35 static scoped_ptr<WifiClient> Create(); | |
36 | |
37 virtual void Start() = 0; | |
38 | |
39 virtual void GetSSIDList(const SSIDListCallback& callback) = 0; | |
40 virtual void RequestScan(const SuccessCallback& callback) = 0; | |
41 | |
42 virtual void ConnectToNetwork(const std::string& ssid, | |
43 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
| |
44 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.
| |
45 const SuccessCallback& callback) = 0; | |
46 | |
47 virtual void ConnectToNetworkByID(const std::string& internal_id, | |
48 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.
| |
49 | |
50 virtual void GetNetworkCredentials(const std::string& internal_id, | |
51 const CredentialsCallback& callback) = 0; | |
52 }; | |
53 | |
54 } // namespace wifi | |
55 | |
56 } // namespace local_discovery | |
57 | |
58 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_WIFI_WIFI_CLIENT_H_ | |
OLD | NEW |