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

Unified Diff: chrome/browser/chromeos/cros/network_library.h

Issue 2817036: Push change for stevenjb:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 6 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
Index: chrome/browser/chromeos/cros/network_library.h
===================================================================
--- chrome/browser/chromeos/cros/network_library.h (revision 50505)
+++ chrome/browser/chromeos/cros/network_library.h (working copy)
@@ -77,6 +77,15 @@
return name_ < other.name();
}
+ // We frequently want to compare networks by service path.
+ struct ServicePathEq {
+ explicit ServicePathEq(const std::string& path_in) : path(path_in) {}
+ bool operator()(const WirelessNetwork& a) {
+ return a.service_path().compare(path) == 0;
+ }
+ const std::string& path;
+ };
+
const std::string& name() const { return name_; }
int strength() const { return strength_; }
bool auto_connect() const { return auto_connect_; }
@@ -289,6 +298,13 @@
// Returns the list of remembered cellular networks.
virtual const CellularNetworkVector& remembered_cellular_networks() const = 0;
+ // Search the current list of networks by path and if the network
+ // is available, copy the result and return true.
+ virtual bool FindWifiNetworkByPath(const std::string& path,
+ WifiNetwork* result) const = 0;
+ virtual bool FindCellularNetworkByPath(const std::string& path,
+ CellularNetwork* result) const = 0;
+
// Request a scan for new wifi networks.
virtual void RequestWifiScan() = 0;
@@ -416,6 +432,11 @@
return remembered_cellular_networks_;
}
+ virtual bool FindWifiNetworkByPath(const std::string& path,
+ WifiNetwork* network) const;
+ virtual bool FindCellularNetworkByPath(const std::string& path,
+ CellularNetwork* network) const;
+
virtual void RequestWifiScan();
virtual bool ConnectToPreferredNetworkIfAvailable();
virtual bool PreferredNetworkConnected();
@@ -493,10 +514,16 @@
WifiNetwork* GetPreferredNetwork();
// Gets the WifiNetwork with the given name. Returns NULL if not found.
+ // Only used by GetPreferredNetwork() to lookup "Google" and "GoogleA" (hack)
WifiNetwork* GetWifiNetworkByName(const std::string& name);
- // Gets the WifiNetwork with the given path. Returns NULL if not found.
- WifiNetwork* GetWifiNetworkByPath(const std::string& path);
+ // Gets the WirelessNetwork (WifiNetwork or CellularNetwork) by path
+ template<typename T>
+ T* GetWirelessNetworkByPath(std::vector<T>& networks,
+ const std::string& path);
+ template<typename T>
+ const T* GetWirelessNetworkByPath(const std::vector<T>& networks,
+ const std::string& path) const;
// Enables/disables the specified network device.
void EnableNetworkDeviceType(ConnectionType device, bool enable);
« no previous file with comments | « chrome/browser/chromeos/cros/mock_network_library.h ('k') | chrome/browser/chromeos/cros/network_library.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698