[shill] Add properties to Profiles.
There are several properties of the Manager that are reflected only in
the default Profile. We create a subclass for this special type of
profile and hand it a const ref to the properties of the Manager class
so it can provide read-only access to these values via RPC.
BUG=chromium-os:17261
TEST=unit tests
STATUS=Verified
Change-Id: I6fa9f2549a0e1af1b9523206bad8ee17e133f399
Reviewed-on: http://gerrit.chromium.org/gerrit/3620
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/manager.cc b/manager.cc
index f1d8ee8..91bede7 100644
--- a/manager.cc
+++ b/manager.cc
@@ -32,33 +32,30 @@
EventDispatcher *dispatcher)
: adaptor_(control_interface->CreateManagerAdaptor(this)),
device_info_(control_interface, dispatcher, this),
- running_(false),
- offline_mode_(false),
- state_(flimflam::kStateOffline) {
+ running_(false) {
HelpRegisterDerivedStrings(flimflam::kAvailableTechnologiesProperty,
&Manager::AvailableTechnologies,
NULL);
+ store_.RegisterString(flimflam::kCheckPortalListProperty,
+ &props_.check_portal_list);
HelpRegisterDerivedStrings(flimflam::kConnectedTechnologiesProperty,
&Manager::ConnectedTechnologies,
NULL);
+ store_.RegisterString(flimflam::kCountryProperty, &props_.country);
HelpRegisterDerivedString(flimflam::kDefaultTechnologyProperty,
&Manager::DefaultTechnology,
NULL);
- store_.RegisterString(flimflam::kCheckPortalListProperty,
- &check_portal_list_);
- store_.RegisterString(flimflam::kCountryProperty, &country_);
- HelpRegisterDerivedStrings(flimflam::kEnabledTechnologiesProperty,
- &Manager::EnabledTechnologies,
- NULL);
- store_.RegisterBool(flimflam::kOfflineModeProperty, &offline_mode_);
- store_.RegisterString(flimflam::kPortalURLProperty, &portal_url_);
- HelpRegisterDerivedString(flimflam::kStateProperty,
- &Manager::CalculateState,
- NULL);
-
HelpRegisterDerivedStrings(flimflam::kDevicesProperty,
&Manager::EnumerateDevices,
NULL);
+ HelpRegisterDerivedStrings(flimflam::kEnabledTechnologiesProperty,
+ &Manager::EnabledTechnologies,
+ NULL);
+ store_.RegisterBool(flimflam::kOfflineModeProperty, &props_.offline_mode);
+ store_.RegisterString(flimflam::kPortalURLProperty, &props_.portal_url);
+ HelpRegisterDerivedString(flimflam::kStateProperty,
+ &Manager::CalculateState,
+ NULL);
HelpRegisterDerivedStrings(flimflam::kServicesProperty,
&Manager::EnumerateAvailableServices,
NULL);