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

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: 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
Index: chromeos/network/network_state_handler.h
diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h
index 534b93669743663cbdbeb7c635e0edcdaef90d55..862c079e2453647e78fadf5ca91d6bfca42d52bc 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 TechnologyEnabled(const std::string& type) const {
Greg Spencer (Chromium) 2013/04/11 21:35:12 Shouldn't this be named something like "IsTechnolo
stevenjb 2013/04/15 18:49:33 Done.
+ return GetTechnologyState(type) == TECHNOLOGY_ENABLED;
+ }
// Asynchronously sets the technology enabled property for |type|.
// kMatchTypeMobile (only) is also supported.
@@ -240,6 +249,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 TechnologyForType(const std::string& type) const;
Greg Spencer (Chromium) 2013/04/11 21:35:12 Maybe GetTechnologyForType? I think usually only
stevenjb 2013/04/15 18:49:33 Done.
+
// Shill property handler instance, owned by this class.
scoped_ptr<internal::ShillPropertyHandler> shill_property_handler_;

Powered by Google App Engine
This is Rietveld 408576698