OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ |
6 #define CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 // A new network connect request canceled this one. | 90 // A new network connect request canceled this one. |
91 static const char kErrorConnectCanceled[]; | 91 static const char kErrorConnectCanceled[]; |
92 | 92 |
93 // Constants for |error_name| from |error_callback| for Disconnect. | 93 // Constants for |error_name| from |error_callback| for Disconnect. |
94 static const char kErrorNotConnected[]; | 94 static const char kErrorNotConnected[]; |
95 | 95 |
96 // Certificate load timed out. | 96 // Certificate load timed out. |
97 static const char kErrorCertLoadTimeout[]; | 97 static const char kErrorCertLoadTimeout[]; |
98 | 98 |
| 99 // Trying to configure an unmanged network but policy prohibits that |
| 100 static const char kErrorUnmanagedNetwork[]; |
| 101 |
99 ~NetworkConnectionHandler() override; | 102 ~NetworkConnectionHandler() override; |
100 | 103 |
101 void AddObserver(NetworkConnectionObserver* observer); | 104 void AddObserver(NetworkConnectionObserver* observer); |
102 void RemoveObserver(NetworkConnectionObserver* observer); | 105 void RemoveObserver(NetworkConnectionObserver* observer); |
103 | 106 |
104 // ConnectToNetwork() will start an asynchronous connection attempt. | 107 // ConnectToNetwork() will start an asynchronous connection attempt. |
105 // On success, |success_callback| will be called. | 108 // On success, |success_callback| will be called. |
106 // On failure, |error_callback| will be called with |error_name| one of the | 109 // On failure, |error_callback| will be called with |error_name| one of the |
107 // constants defined above. | 110 // constants defined above. |
108 // |error_message| will contain an additional error string for debugging. | 111 // |error_message| will contain an additional error string for debugging. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 163 |
161 // Callback from Shill.Service.GetProperties. Parses |properties| to verify | 164 // Callback from Shill.Service.GetProperties. Parses |properties| to verify |
162 // whether or not the network appears to be configured. If configured, | 165 // whether or not the network appears to be configured. If configured, |
163 // attempts a connection, otherwise invokes error_callback from | 166 // attempts a connection, otherwise invokes error_callback from |
164 // pending_requests_[service_path]. |check_error_state| is passed from | 167 // pending_requests_[service_path]. |check_error_state| is passed from |
165 // ConnectToNetwork(), see comment for info. | 168 // ConnectToNetwork(), see comment for info. |
166 void VerifyConfiguredAndConnect(bool check_error_state, | 169 void VerifyConfiguredAndConnect(bool check_error_state, |
167 const std::string& service_path, | 170 const std::string& service_path, |
168 const base::DictionaryValue& properties); | 171 const base::DictionaryValue& properties); |
169 | 172 |
| 173 bool IsNetworkProhibitedByPolicy(const std::string& guid, |
| 174 const std::string& profile_path); |
| 175 |
170 // Queues a connect request until certificates have loaded. | 176 // Queues a connect request until certificates have loaded. |
171 void QueueConnectRequest(const std::string& service_path); | 177 void QueueConnectRequest(const std::string& service_path); |
172 | 178 |
173 // Checks to see if certificates have loaded and if not, cancels any queued | 179 // Checks to see if certificates have loaded and if not, cancels any queued |
174 // connect request and notifies the user. | 180 // connect request and notifies the user. |
175 void CheckCertificatesLoaded(); | 181 void CheckCertificatesLoaded(); |
176 | 182 |
177 // Handles connecting to a queued network after certificates are loaded or | 183 // Handles connecting to a queued network after certificates are loaded or |
178 // handle cert load timeout. | 184 // handle cert load timeout. |
179 void ConnectToQueuedNetwork(); | 185 void ConnectToQueuedNetwork(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 bool logged_in_; | 249 bool logged_in_; |
244 bool certificates_loaded_; | 250 bool certificates_loaded_; |
245 base::TimeTicks logged_in_time_; | 251 base::TimeTicks logged_in_time_; |
246 | 252 |
247 DISALLOW_COPY_AND_ASSIGN(NetworkConnectionHandler); | 253 DISALLOW_COPY_AND_ASSIGN(NetworkConnectionHandler); |
248 }; | 254 }; |
249 | 255 |
250 } // namespace chromeos | 256 } // namespace chromeos |
251 | 257 |
252 #endif // CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ | 258 #endif // CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ |
OLD | NEW |