Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3746)

Unified Diff: chromeos/network/network_state_handler.h

Issue 13004024: Add ConnectToBestServices call when Certs are loaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/shill_manager_client_stub.cc ('k') | chromeos/network/network_state_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_state_handler.h
diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h
index 31d1de65df73b9dfd796ed8f1cbde4cc1847a0c5..ce65e0d554083e85fd47a018fe7eeb40270fb71a 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);
};
« no previous file with comments | « chromeos/dbus/shill_manager_client_stub.cc ('k') | chromeos/network/network_state_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698