OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_UTILITY_WIFI_WIFI_SERVICE_H_ | 5 #ifndef CHROME_UTILITY_WIFI_WIFI_SERVICE_H_ |
6 #define CHROME_UTILITY_WIFI_WIFI_SERVICE_H_ | 6 #define CHROME_UTILITY_WIFI_WIFI_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/message_loop/message_loop_proxy.h" | |
16 #include "base/threading/sequenced_worker_pool.h" | 15 #include "base/threading/sequenced_worker_pool.h" |
17 #include "base/values.h" | 16 #include "base/values.h" |
18 #include "components/wifi/wifi_export.h" | 17 #include "components/wifi/wifi_export.h" |
19 | 18 |
20 namespace wifi { | 19 namespace wifi { |
21 | 20 |
22 // WiFiService interface used by implementation of chrome.networkingPrivate | 21 // WiFiService interface used by implementation of chrome.networkingPrivate |
23 // JavaScript extension API. All methods should be called on worker thread. | 22 // JavaScript extension API. All methods should be called on worker thread. |
24 // It could be created on any (including UI) thread, so nothing expensive should | 23 // It could be created on any (including UI) thread, so nothing expensive should |
25 // be done in the constructor. See |NetworkingPrivateService| for wrapper | 24 // be done in the constructor. See |NetworkingPrivateService| for wrapper |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 100 |
102 // Get WiFi Key for network identified by |network_guid| from the | 101 // Get WiFi Key for network identified by |network_guid| from the |
103 // system (if it has one) and store it in |key_data|. User privilege elevation | 102 // system (if it has one) and store it in |key_data|. User privilege elevation |
104 // may be required, and function will fail if user privileges are not | 103 // may be required, and function will fail if user privileges are not |
105 // sufficient. Populates |error| on failure. | 104 // sufficient. Populates |error| on failure. |
106 virtual void GetKeyFromSystem(const std::string& network_guid, | 105 virtual void GetKeyFromSystem(const std::string& network_guid, |
107 std::string* key_data, | 106 std::string* key_data, |
108 std::string* error) = 0; | 107 std::string* error) = 0; |
109 | 108 |
110 // Set observers to run when |NetworksChanged| and |NetworksListChanged| | 109 // Set observers to run when |NetworksChanged| and |NetworksListChanged| |
111 // events needs to be sent. Notifications are posted on |message_loop_proxy|. | 110 // events needs to be sent. Notifications are posted on |task_runner|. |
112 virtual void SetEventObservers( | 111 virtual void SetEventObservers( |
113 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, | 112 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
114 const NetworkGuidListCallback& networks_changed_observer, | 113 const NetworkGuidListCallback& networks_changed_observer, |
115 const NetworkGuidListCallback& network_list_changed_observer) = 0; | 114 const NetworkGuidListCallback& network_list_changed_observer) = 0; |
116 | 115 |
117 // Request update of Connected Network information. Send |NetworksChanged| | 116 // Request update of Connected Network information. Send |NetworksChanged| |
118 // event on completion. | 117 // event on completion. |
119 virtual void RequestConnectedNetworkUpdate() = 0; | 118 virtual void RequestConnectedNetworkUpdate() = 0; |
120 | 119 |
121 // Get the SSID of the currently connected network, if any. | 120 // Get the SSID of the currently connected network, if any. |
122 virtual void GetConnectedNetworkSSID(std::string* ssid, | 121 virtual void GetConnectedNetworkSSID(std::string* ssid, |
123 std::string* error) = 0; | 122 std::string* error) = 0; |
(...skipping 11 matching lines...) Expand all Loading... |
135 static const char kErrorScanForNetworksWithName[]; | 134 static const char kErrorScanForNetworksWithName[]; |
136 static const char kErrorWiFiService[]; | 135 static const char kErrorWiFiService[]; |
137 | 136 |
138 private: | 137 private: |
139 DISALLOW_COPY_AND_ASSIGN(WiFiService); | 138 DISALLOW_COPY_AND_ASSIGN(WiFiService); |
140 }; | 139 }; |
141 | 140 |
142 } // namespace wifi | 141 } // namespace wifi |
143 | 142 |
144 #endif // CHROME_UTILITY_WIFI_WIFI_SERVICE_H_ | 143 #endif // CHROME_UTILITY_WIFI_WIFI_SERVICE_H_ |
OLD | NEW |