| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" |
| 10 #include "base/string16.h" | 12 #include "base/string16.h" |
| 11 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 12 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
| 13 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/chromeos/cros/cros_library.h" | 17 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 16 #include "chrome/browser/chromeos/wm_ipc.h" | 18 #include "chrome/browser/chromeos/wm_ipc.h" |
| 17 #include "chrome/browser/policy/browser_policy_connector.h" | 19 #include "chrome/browser/policy/browser_policy_connector.h" |
| 18 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
| 19 #include "chrome/common/chrome_version_info.h" | 21 #include "chrome/common/chrome_version_info.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 34 : delegate_(delegate) { | 36 : delegate_(delegate) { |
| 35 } | 37 } |
| 36 | 38 |
| 37 VersionInfoUpdater::~VersionInfoUpdater() { | 39 VersionInfoUpdater::~VersionInfoUpdater() { |
| 38 } | 40 } |
| 39 | 41 |
| 40 void VersionInfoUpdater::StartUpdate(bool is_official_build) { | 42 void VersionInfoUpdater::StartUpdate(bool is_official_build) { |
| 41 if (CrosLibrary::Get()->EnsureLoaded()) { | 43 if (CrosLibrary::Get()->EnsureLoaded()) { |
| 42 version_loader_.GetVersion( | 44 version_loader_.GetVersion( |
| 43 &version_consumer_, | 45 &version_consumer_, |
| 44 NewCallback(this, &VersionInfoUpdater::OnVersion), | 46 base::Bind(&VersionInfoUpdater::OnVersion, base::Unretained(this)), |
| 45 is_official_build ? | 47 is_official_build ? |
| 46 VersionLoader::VERSION_SHORT_WITH_DATE : | 48 VersionLoader::VERSION_SHORT_WITH_DATE : |
| 47 VersionLoader::VERSION_FULL); | 49 VersionLoader::VERSION_FULL); |
| 48 if (!is_official_build) { | 50 if (!is_official_build) { |
| 49 boot_times_loader_.GetBootTimes( | 51 boot_times_loader_.GetBootTimes( |
| 50 &boot_times_consumer_, | 52 &boot_times_consumer_, |
| 51 NewCallback(this, &VersionInfoUpdater::OnBootTimes)); | 53 NewCallback(this, &VersionInfoUpdater::OnBootTimes)); |
| 52 } | 54 } |
| 53 } else { | 55 } else { |
| 54 UpdateVersionLabel(); | 56 UpdateVersionLabel(); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 delegate_->OnBootTimesLabelTextUpdated(boot_times_text); | 193 delegate_->OnBootTimesLabelTextUpdated(boot_times_text); |
| 192 } | 194 } |
| 193 | 195 |
| 194 void VersionInfoUpdater::OnPolicyStateChanged( | 196 void VersionInfoUpdater::OnPolicyStateChanged( |
| 195 policy::CloudPolicySubsystem::PolicySubsystemState state, | 197 policy::CloudPolicySubsystem::PolicySubsystemState state, |
| 196 policy::CloudPolicySubsystem::ErrorDetails error_details) { | 198 policy::CloudPolicySubsystem::ErrorDetails error_details) { |
| 197 UpdateEnterpriseInfo(); | 199 UpdateEnterpriseInfo(); |
| 198 } | 200 } |
| 199 | 201 |
| 200 } // namespace chromeos | 202 } // namespace chromeos |
| OLD | NEW |