Chromium Code Reviews| Index: chrome/browser/chromeos/login/version_info_updater.cc |
| diff --git a/chrome/browser/chromeos/login/version_info_updater.cc b/chrome/browser/chromeos/login/version_info_updater.cc |
| index 84ff2ce3dba8f6e4ef39829ce28d6d30e1644118..8f443ea03d3d95b1c7c40c00b3142bea65d5db02 100644 |
| --- a/chrome/browser/chromeos/login/version_info_updater.cc |
| +++ b/chrome/browser/chromeos/login/version_info_updater.cc |
| @@ -27,17 +27,6 @@ |
| namespace chromeos { |
| -namespace { |
| - |
| -const char* kReportingFlags[] = { |
| - chromeos::kReportDeviceVersionInfo, |
| - chromeos::kReportDeviceActivityTimes, |
| - chromeos::kReportDeviceBootMode, |
| - chromeos::kReportDeviceLocation, |
| -}; |
| - |
| -} |
| - |
| /////////////////////////////////////////////////////////////////////////////// |
| // VersionInfoUpdater public: |
| @@ -53,9 +42,6 @@ VersionInfoUpdater::~VersionInfoUpdater() { |
| GetDeviceCloudPolicyManager(); |
| if (policy_manager) |
| policy_manager->core()->store()->RemoveObserver(this); |
| - |
| - for (unsigned int i = 0; i < arraysize(kReportingFlags); ++i) |
| - cros_settings_->RemoveSettingsObserver(kReportingFlags[i], this); |
| } |
| void VersionInfoUpdater::StartUpdate(bool is_official_build) { |
| @@ -82,8 +68,22 @@ void VersionInfoUpdater::StartUpdate(bool is_official_build) { |
| } |
| // Watch for changes to the reporting flags. |
| - for (unsigned int i = 0; i < arraysize(kReportingFlags); ++i) |
| - cros_settings_->AddSettingsObserver(kReportingFlags[i], this); |
| + version_info_subscription_ = cros_settings_->AddSettingsObserver( |
| + kReportDeviceVersionInfo, |
| + base::Bind(&VersionInfoUpdater::UpdateEnterpriseInfo, |
|
Lei Zhang
2013/09/18 05:00:53
Can you assign this to a base::Closure variable an
Mattias Nissler (ping if slow)
2013/09/18 09:09:48
Could also keep the array and loop in that case an
Avi (use Gerrit)
2013/09/18 16:41:44
Done.
Lei Zhang
2013/09/18 18:51:07
chrome/browser/chromeos/login/existing_user_contro
Avi (use Gerrit)
2013/09/18 19:39:07
If you look at ExistingUserControllerAutoLoginTest
|
| + base::Unretained(this))); |
| + activity_times_subscription_ = cros_settings_->AddSettingsObserver( |
| + kReportDeviceActivityTimes, |
| + base::Bind(&VersionInfoUpdater::UpdateEnterpriseInfo, |
| + base::Unretained(this))); |
| + boot_mode_subscription_ = cros_settings_->AddSettingsObserver( |
| + kReportDeviceBootMode, |
| + base::Bind(&VersionInfoUpdater::UpdateEnterpriseInfo, |
| + base::Unretained(this))); |
| + location_subscription_ = cros_settings_->AddSettingsObserver( |
| + kReportDeviceLocation, |
| + base::Bind(&VersionInfoUpdater::UpdateEnterpriseInfo, |
| + base::Unretained(this))); |
| } |
| void VersionInfoUpdater::UpdateVersionLabel() { |
| @@ -134,14 +134,4 @@ void VersionInfoUpdater::OnStoreError(policy::CloudPolicyStore* store) { |
| UpdateEnterpriseInfo(); |
| } |
| -void VersionInfoUpdater::Observe( |
| - int type, |
| - const content::NotificationSource& source, |
| - const content::NotificationDetails& details) { |
| - if (type == chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED) |
| - UpdateEnterpriseInfo(); |
| - else |
| - NOTREACHED(); |
| -} |
| - |
| } // namespace chromeos |