| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/chromeos/login/version_info_updater.h" | 5 #include "chrome/browser/chromeos/login/version_info_updater.h" | 
| 6 | 6 | 
| 7 #include <vector> | 7 #include <vector> | 
| 8 | 8 | 
| 9 #include "base/bind.h" | 9 #include "base/bind.h" | 
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" | 
| 11 #include "base/chromeos/chromeos_version.h" |  | 
| 12 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" | 
| 13 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" | 
| 14 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" | 
|  | 14 #include "base/sys_info.h" | 
| 15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" | 
| 16 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 16 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 
| 17 #include "chrome/browser/chromeos/settings/cros_settings.h" | 17 #include "chrome/browser/chromeos/settings/cros_settings.h" | 
| 18 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 18 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 
| 19 #include "chrome/browser/policy/browser_policy_connector.h" | 19 #include "chrome/browser/policy/browser_policy_connector.h" | 
| 20 #include "chrome/common/chrome_version_info.h" | 20 #include "chrome/common/chrome_version_info.h" | 
| 21 #include "grit/chromium_strings.h" | 21 #include "grit/chromium_strings.h" | 
| 22 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" | 
| 23 #include "grit/theme_resources.h" | 23 #include "grit/theme_resources.h" | 
| 24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 48 | 48 | 
| 49 VersionInfoUpdater::~VersionInfoUpdater() { | 49 VersionInfoUpdater::~VersionInfoUpdater() { | 
| 50   policy::DeviceCloudPolicyManagerChromeOS* policy_manager = | 50   policy::DeviceCloudPolicyManagerChromeOS* policy_manager = | 
| 51       g_browser_process->browser_policy_connector()-> | 51       g_browser_process->browser_policy_connector()-> | 
| 52           GetDeviceCloudPolicyManager(); | 52           GetDeviceCloudPolicyManager(); | 
| 53   if (policy_manager) | 53   if (policy_manager) | 
| 54     policy_manager->core()->store()->RemoveObserver(this); | 54     policy_manager->core()->store()->RemoveObserver(this); | 
| 55 } | 55 } | 
| 56 | 56 | 
| 57 void VersionInfoUpdater::StartUpdate(bool is_official_build) { | 57 void VersionInfoUpdater::StartUpdate(bool is_official_build) { | 
| 58   if (base::chromeos::IsRunningOnChromeOS()) { | 58   if (base::SysInfo::IsRunningOnChromeOS()) { | 
| 59     version_loader_.GetVersion( | 59     version_loader_.GetVersion( | 
| 60         is_official_build ? VersionLoader::VERSION_SHORT_WITH_DATE | 60         is_official_build ? VersionLoader::VERSION_SHORT_WITH_DATE | 
| 61                           : VersionLoader::VERSION_FULL, | 61                           : VersionLoader::VERSION_FULL, | 
| 62         base::Bind(&VersionInfoUpdater::OnVersion, | 62         base::Bind(&VersionInfoUpdater::OnVersion, | 
| 63                    weak_pointer_factory_.GetWeakPtr()), | 63                    weak_pointer_factory_.GetWeakPtr()), | 
| 64         &tracker_); | 64         &tracker_); | 
| 65   } else { | 65   } else { | 
| 66     UpdateVersionLabel(); | 66     UpdateVersionLabel(); | 
| 67   } | 67   } | 
| 68 | 68 | 
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 130 | 130 | 
| 131 void VersionInfoUpdater::OnStoreLoaded(policy::CloudPolicyStore* store) { | 131 void VersionInfoUpdater::OnStoreLoaded(policy::CloudPolicyStore* store) { | 
| 132   UpdateEnterpriseInfo(); | 132   UpdateEnterpriseInfo(); | 
| 133 } | 133 } | 
| 134 | 134 | 
| 135 void VersionInfoUpdater::OnStoreError(policy::CloudPolicyStore* store) { | 135 void VersionInfoUpdater::OnStoreError(policy::CloudPolicyStore* store) { | 
| 136   UpdateEnterpriseInfo(); | 136   UpdateEnterpriseInfo(); | 
| 137 } | 137 } | 
| 138 | 138 | 
| 139 }  // namespace chromeos | 139 }  // namespace chromeos | 
| OLD | NEW | 
|---|