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

Unified Diff: chromeos/network/network_state_handler.h

Issue 14137017: Add TechnologyState to NetworkStateHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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/network/device_state.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 92bb01e5cfb6ec9699976f7f0b15e37ae668008c..a68e33ad1013d4d1cbc955a9461bd7c89e4c493b 100644
--- a/chromeos/network/network_state_handler.h
+++ b/chromeos/network/network_state_handler.h
@@ -57,6 +57,14 @@ class CHROMEOS_EXPORT NetworkStateHandler
typedef std::vector<ManagedState*> ManagedStateList;
typedef std::vector<const NetworkState*> NetworkStateList;
+ enum TechnologyState {
+ TECHNOLOGY_UNAVAILABLE,
+ TECHNOLOGY_AVAILABLE,
+ TECHNOLOGY_UNINITIALIZED,
+ TECHNOLOGY_ENABLING,
+ TECHNOLOGY_ENABLED
+ };
+
virtual ~NetworkStateHandler();
// Sets the global instance. Must be called before any calls to Get().
@@ -75,11 +83,12 @@ class CHROMEOS_EXPORT NetworkStateHandler
void AddObserver(NetworkStateHandlerObserver* observer);
void RemoveObserver(NetworkStateHandlerObserver* observer);
- // Returns true if technology for |type| is available/ enabled/uninitialized.
- // kMatchTypeMobile (only) is also supported.
- bool TechnologyAvailable(const std::string& type) const;
- bool TechnologyEnabled(const std::string& type) const;
- bool TechnologyUninitialized(const std::string& type) const;
+ // Returns the state for technology |type|. kMatchTypeMobile (only) is
+ // also supported.
+ TechnologyState GetTechnologyState(const std::string& type) const;
+ bool IsTechnologyEnabled(const std::string& type) const {
+ return GetTechnologyState(type) == TECHNOLOGY_ENABLED;
+ }
// Asynchronously sets the technology enabled property for |type|.
// kMatchTypeMobile (only) is also supported.
@@ -244,6 +253,9 @@ class CHROMEOS_EXPORT NetworkStateHandler
// Called whenever Device.Scanning state transitions to false.
void ScanCompleted(const std::string& type);
+ // Returns the technology type for |type|.
+ std::string GetTechnologyForType(const std::string& type) const;
+
// Shill property handler instance, owned by this class.
scoped_ptr<internal::ShillPropertyHandler> shill_property_handler_;
« no previous file with comments | « chromeos/network/device_state.cc ('k') | chromeos/network/network_state_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698