summaryrefslogtreecommitdiffstats
path: root/chromeos/network/network_state_handler.h
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-01 21:50:22 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-01 21:50:22 +0000
commit8617f9894392027da2e5bb91a033e343acae9d34 (patch)
treea3d2c0aed37649bf74d36739613b772849dfdb2a /chromeos/network/network_state_handler.h
parentb042ecf69a057ca5ed09540e1a1b6aef28a8ee62 (diff)
downloadchromium_src-8617f9894392027da2e5bb91a033e343acae9d34.zip
chromium_src-8617f9894392027da2e5bb91a033e343acae9d34.tar.gz
chromium_src-8617f9894392027da2e5bb91a033e343acae9d34.tar.bz2
Add ConnectToBestServices call when Certs are loaded
BUG=137711 Review URL: https://codereview.chromium.org/13004024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/network/network_state_handler.h')
-rw-r--r--chromeos/network/network_state_handler.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h
index 31d1de6..ce65e0d 100644
--- a/chromeos/network/network_state_handler.h
+++ b/chromeos/network/network_state_handler.h
@@ -10,6 +10,7 @@
#include <string>
#include <vector>
+#include "base/callback_forward.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
@@ -139,6 +140,14 @@ class CHROMEOS_EXPORT NetworkStateHandler
// list, which will trigger the appropriate observer calls.
void RequestScan() const;
+ // Request a scan if not scanning and run |callback| when the Scanning state
+ // for any Device matching |type| completes.
+ void WaitForScan(const std::string& type, const base::Closure& callback);
+
+ // Request a network scan then signal Shill to connect to the best available
+ // networks when completed.
+ void ConnectToBestWifiNetwork();
+
// Set the user initiated connecting network.
void SetConnectingNetwork(const std::string& service_path);
@@ -203,6 +212,8 @@ class CHROMEOS_EXPORT NetworkStateHandler
void InitShillPropertyHandler();
private:
+ typedef std::list<base::Closure> ScanCallbackList;
+ typedef std::map<std::string, ScanCallbackList> ScanCompleteCallbackMap;
friend class NetworkStateHandlerTest;
FRIEND_TEST_ALL_PREFIXES(NetworkStateHandlerTest, NetworkStateHandlerStub);
@@ -231,6 +242,9 @@ class CHROMEOS_EXPORT NetworkStateHandler
// Notifies observers and updates connecting_network_.
void NetworkPropertiesUpdated(const NetworkState* network);
+ // Called whenever Device.Scanning state transitions to false.
+ void ScanCompleted(const std::string& type);
+
// Shill property handler instance, owned by this class.
scoped_ptr<internal::ShillPropertyHandler> shill_property_handler_;
@@ -250,6 +264,9 @@ class CHROMEOS_EXPORT NetworkStateHandler
// TODO(stevenjb): Move this to NetworkConfigurationHandler.
std::string connecting_network_;
+ // Callbacks to run when a scan for the technology type completes.
+ ScanCompleteCallbackMap scan_complete_callbacks_;
+
DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler);
};