| Index: src/service_manager.h
|
| diff --git a/src/service_manager.h b/src/service_manager.h
|
| index 0e432d6278430fc651c05ab7ab1deb522de06d3a..36a7e7a14380f08120d7d5e7d11811d2e3f086d4 100644
|
| --- a/src/service_manager.h
|
| +++ b/src/service_manager.h
|
| @@ -44,6 +44,26 @@ class ServiceManager : public org::chromium::flimflam::Manager_proxy,
|
| // will go into a black hole.
|
| virtual void SetCashewServer(CashewServer *cashew_server);
|
|
|
| + // return our latest info on the current default technology
|
| + virtual Service::Type GetDefaultTechnology() const;
|
| +
|
| + // valid Flimflam global connectivity state values
|
| + typedef enum {
|
| + kConnectivityStateUnknown = 0,
|
| + kConnectivityStateOffline,
|
| + kConnectivityStateConnected,
|
| + kConnectivityStateOnline,
|
| + } ConnectivityState;
|
| +
|
| + // return our latest info on Flimflam's global connectivity state
|
| + virtual ConnectivityState GetConnectivityState() const;
|
| +
|
| + // does |state| represent an offline state
|
| + static bool IsOfflineConnectivityState(ConnectivityState state);
|
| +
|
| + // does |state| represent an online state
|
| + static bool IsOnlineConnectivityState(ConnectivityState state);
|
| +
|
| // Flimflam Manager D-Bus Proxy methods
|
|
|
| // receive incoming PropertyChanged D-Bus signal from Flimflam
|
| @@ -51,7 +71,7 @@ class ServiceManager : public org::chromium::flimflam::Manager_proxy,
|
| const DBus::Variant& new_value);
|
|
|
| // receive incoming StateChanged D-Bus signal from Flimflam
|
| - virtual void StateChanged(const std::string& new_state);
|
| + virtual void StateChanged(const std::string& new_state_string);
|
|
|
| // Service methods
|
|
|
| @@ -69,11 +89,26 @@ class ServiceManager : public org::chromium::flimflam::Manager_proxy,
|
| // Cashew server implementing our front-end interface
|
| CashewServer *cashew_server_;
|
|
|
| + // default technology most recently reported by Flimflam
|
| + Service::Type default_technology_;
|
| +
|
| + // the cellular service, if any, that we think is the default service
|
| + // can be NULL if we don't know the default service or a non-cellular
|
| + // service is the default
|
| + Service *default_cellular_service_;
|
| +
|
| + // global connectivity state most recently reported by Flimflam
|
| + ConnectivityState connectivity_state_;
|
| +
|
| // delete a collection of services
|
| void DeleteServices(ServiceMap *service_map);
|
|
|
| - // get Services info from Flimflam
|
| - void GetFlimflamServices();
|
| + // get interesting properties from Flimflam such as Services and
|
| + // DefaultTechnology
|
| + void GetFlimflamProperties();
|
| +
|
| + // we've received updated DefaultTechnology info from Flimflam
|
| + void OnDefaultTechnologyUpdate(const std::string& default_technology);
|
|
|
| // we've received updated Services info from Flimflam
|
| void OnServicesUpdate(const ServicePathList& paths);
|
| @@ -81,6 +116,31 @@ class ServiceManager : public org::chromium::flimflam::Manager_proxy,
|
| // Flimflam has started advertising a new service
|
| void OnNewService(const DBus::Path& path);
|
|
|
| + // we've received updated default service info from Flimflam
|
| + // NULL |path| means that there is no default service
|
| + void OnDefaultServiceUpdate(const DBus::Path *path);
|
| +
|
| + // if |default_cellular_service_| points to a service, tell it
|
| + // that it is no longer the default service and clear our ptr
|
| + void ClearDefaultCellularService();
|
| +
|
| + // tell |service| that it is now the default service and set our
|
| + // |default_cellular_service_| ptr to point to it.
|
| + // if there is already a default service, first clear it.
|
| + // NULL |service| is ok and is equivalent to ClearDefaultCellularService
|
| + // no-op if |service| == |default_cellular_service_|
|
| + void SetDefaultCellularService(Service *service);
|
| +
|
| + // convert connectivity state string to ConnectivityState enum value
|
| + static ConnectivityState ConnectivityStateFromString(
|
| + const std::string& state);
|
| +
|
| + // Flimflam has told us that it has come online
|
| + void OnFlimflamOnline();
|
| +
|
| + // Flimflam has told us that it has gone offline
|
| + void OnFlimflamOffline();
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ServiceManager);
|
| };
|
|
|
|
|