1a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 2a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 3a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// found in the LICENSE file. 4a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 5a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)#ifndef CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ 6a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)#define CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ 7a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 8a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)#include <set> 9a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)#include <string> 10a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 11a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)#include "base/basictypes.h" 12a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)#include "base/callback.h" 13a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)#include "base/memory/weak_ptr.h" 14a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)#include "base/values.h" 15558790d6acca3451cf3a6b497803a5f07d0bec58Ben Murdoch#include "chromeos/cert_loader.h" 16a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)#include "chromeos/chromeos_export.h" 17a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)#include "chromeos/dbus/dbus_method_call_status.h" 187d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "chromeos/login/login_state.h" 1990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "chromeos/network/network_handler.h" 20a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)#include "chromeos/network/network_handler_callbacks.h" 21868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "chromeos/network/network_state_handler_observer.h" 22a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 23a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)namespace chromeos { 24a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 25a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)class NetworkState; 267d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)class NetworkUIData; 27a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 28a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// The NetworkConnectionHandler class is used to manage network connection 29a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// requests. This is the only class that should make Shill Connect calls. 30a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// It handles the following steps: 31a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// 1. Determine whether or not sufficient information (e.g. passphrase) is 32a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// known to be available to connect to the network. 33a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// 2. Request additional information (e.g. user data which contains certificate 34a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// information) and determine whether sufficient information is available. 357d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// 3. Possibly configure the network certificate info (tpm slot and pkcs11 id). 367d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// 4. Send the connect request. 377d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// 5. Wait for the network state to change to a non connecting state. 387d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)// 6. Invoke the appropriate callback (always) on success or failure. 39a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// 40a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// NetworkConnectionHandler depends on NetworkStateHandler for immediately 41a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// available State information, and NetworkConfigurationHandler for any 42a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// configuration calls. 43a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 44a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)class CHROMEOS_EXPORT NetworkConnectionHandler 457d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) : public LoginState::Observer, 467d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) public CertLoader::Observer, 477d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) public NetworkStateHandlerObserver, 48868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) public base::SupportsWeakPtr<NetworkConnectionHandler> { 49a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) public: 50868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // Constants for |error_name| from |error_callback| for Connect. 5158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 5258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // No network matching |service_path| is found (hidden networks must be 5358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // configured before connecting). 54a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) static const char kErrorNotFound[]; 5558537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 5658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // Already connected to the network. 57a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) static const char kErrorConnected[]; 5858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 5958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // Already connecting to the network. 60a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) static const char kErrorConnecting[]; 6158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 6258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // The passphrase is missing or invalid. 63a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) static const char kErrorPassphraseRequired[]; 6458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 65a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) static const char kErrorActivationRequired[]; 6658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 6758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // The network requires a cert and none exists. 68a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) static const char kErrorCertificateRequired[]; 6958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 7058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // The network had an authentication error, indicating that additional or 7158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // different authentication information is required. 72a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles) static const char kErrorAuthenticationRequired[]; 7358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 7458537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // Additional configuration is required. 75a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) static const char kErrorConfigurationRequired[]; 7658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 7758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // Configuration failed during the configure stage of the connect flow. 78ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16Ben Murdoch static const char kErrorConfigureFailed[]; 7958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 8058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // For Disconnect or Activate, an unexpected DBus or Shill error occurred. 8158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) static const char kErrorShillError[]; 8258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 8358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // A new network connect request canceled this one. 84ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16Ben Murdoch static const char kErrorConnectCanceled[]; 85868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 86868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // Constants for |error_name| from |error_callback| for Disconnect. 87868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) static const char kErrorNotConnected[]; 88a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 89868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) virtual ~NetworkConnectionHandler(); 90a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 91a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // ConnectToNetwork() will start an asynchronous connection attempt. 92a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // On success, |success_callback| will be called. 9358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // On failure, |error_callback| will be called with |error_name| one of the 9468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) // constants defined above, or shill::kErrorConnectFailed or 9568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) // shill::kErrorBadPassphrase if the Shill Error property (from a 9658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // previous connect attempt) was set to one of those. 97a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // |error_message| will contain an additional error string for debugging. 98a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles) // If |check_error_state| is true, the current state of the network is 99a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles) // checked for errors, otherwise current state is ignored (e.g. for recently 100a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles) // configured networks or repeat attempts). 101a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) void ConnectToNetwork(const std::string& service_path, 102a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) const base::Closure& success_callback, 10390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) const network_handler::ErrorCallback& error_callback, 104a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles) bool check_error_state); 105a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 1067dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch // DisconnectNetwork() will send a Disconnect request to Shill. 107a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // On success, |success_callback| will be called. 108a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // On failure, |error_callback| will be called with |error_name| one of: 109a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // kErrorNotFound if no network matching |service_path| is found. 110a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // kErrorNotConnected if not connected to the network. 111a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // kErrorShillError if a DBus or Shill error occurred. 112a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // |error_message| will contain and additional error string for debugging. 113a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) void DisconnectNetwork(const std::string& service_path, 114a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) const base::Closure& success_callback, 115a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) const network_handler::ErrorCallback& error_callback); 116a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 117868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // Returns true if ConnectToNetwork has been called with |service_path| and 118868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // has not completed (i.e. success or error callback has been called). 119868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) bool HasConnectingNetwork(const std::string& service_path); 120868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 1213551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) // Returns true if there are any pending connect requests. 1223551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) bool HasPendingConnectRequest(); 1233551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) 124868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // NetworkStateHandlerObserver 125868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) virtual void NetworkListChanged() OVERRIDE; 126868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) virtual void NetworkPropertiesUpdated(const NetworkState* network) OVERRIDE; 127868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 1287d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) // LoginState::Observer 129d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles) virtual void LoggedInStateChanged() OVERRIDE; 1307d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) 1317d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) // CertLoader::Observer 1327d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) virtual void OnCertificatesLoaded(const net::CertificateList& cert_list, 1337d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) bool initial_load) OVERRIDE; 1347d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) 135a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) private: 13690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) friend class NetworkHandler; 13790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) friend class NetworkConnectionHandlerTest; 138868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 139868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) struct ConnectRequest; 140868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 141a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) NetworkConnectionHandler(); 14290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 143558790d6acca3451cf3a6b497803a5f07d0bec58Ben Murdoch void Init(NetworkStateHandler* network_state_handler, 14490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) NetworkConfigurationHandler* network_configuration_handler); 145a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 146c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch ConnectRequest* GetPendingRequest(const std::string& service_path); 147a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 148a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // Callback from Shill.Service.GetProperties. Parses |properties| to verify 149a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // whether or not the network appears to be configured. If configured, 150868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // attempts a connection, otherwise invokes error_callback from 151a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles) // pending_requests_[service_path]. |check_error_state| is passed from 152a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles) // ConnectToNetwork(), see comment for info. 153a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles) void VerifyConfiguredAndConnect(bool check_error_state, 154a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles) const std::string& service_path, 155868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) const base::DictionaryValue& properties); 156a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 157868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // Calls Shill.Manager.Connect asynchronously. 158868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) void CallShillConnect(const std::string& service_path); 159a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 160a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // Handle failure from ConfigurationHandler calls. 161a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) void HandleConfigurationFailure( 162a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) const std::string& service_path, 163a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) const std::string& error_name, 164a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) scoped_ptr<base::DictionaryValue> error_data); 165a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 166a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) // Handle success or failure from Shill.Service.Connect. 167868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) void HandleShillConnectSuccess(const std::string& service_path); 168868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) void HandleShillConnectFailure(const std::string& service_path, 169868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) const std::string& error_name, 170868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) const std::string& error_message); 171868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 172868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) void CheckPendingRequest(const std::string service_path); 173868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) void CheckAllPendingRequests(); 174c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch 175c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch // Returns the PKCS#11 ID of a cert matching the certificate pattern in 176c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch // |ui_data|. Returns empty string otherwise. 177c2db58bd994c04d98e4ee2cd7565b71548655fe3Ben Murdoch std::string CertificateIsConfigured(NetworkUIData* ui_data); 1787d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) void ErrorCallbackForPendingRequest(const std::string& service_path, 1797d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) const std::string& error_name); 180868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 181868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // Calls Shill.Manager.Disconnect asynchronously. 182868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) void CallShillDisconnect( 183868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) const std::string& service_path, 184868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) const base::Closure& success_callback, 185868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) const network_handler::ErrorCallback& error_callback); 186868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 187ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16Ben Murdoch // Handle success from Shill.Service.Disconnect. 188868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) void HandleShillDisconnectSuccess(const std::string& service_path, 189868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) const base::Closure& success_callback); 190a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 191ba5b9a6411cb1792fd21f0a078d7a25cd1ceec16Ben Murdoch 19290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) // Local references to the associated handler instances. 1937d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) CertLoader* cert_loader_; 19490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) NetworkStateHandler* network_state_handler_; 19590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) NetworkConfigurationHandler* network_configuration_handler_; 19690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 1977d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) // Map of pending connect requests, used to prevent repeated attempts while 198868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // waiting for Shill and to trigger callbacks on eventual success or failure. 199868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) std::map<std::string, ConnectRequest> pending_requests_; 2007d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) scoped_ptr<ConnectRequest> queued_connect_; 2017d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) 2027d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) // Track certificate loading state. 2037d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) bool logged_in_; 2047d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) bool certificates_loaded_; 205a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 206a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(NetworkConnectionHandler); 207a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)}; 208a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 209a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)} // namespace chromeos 210a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 211a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)#endif // CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ 212