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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/chromeos/chromeos_version.h" |
12 #include "base/string16.h" | 13 #include "base/string16.h" |
13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
14 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
15 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
16 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/chromeos/cros/cros_library.h" | 18 #include "chrome/browser/chromeos/cros/cros_library.h" |
18 #include "chrome/browser/chromeos/system/runtime_environment.h" | |
19 #include "chrome/browser/policy/browser_policy_connector.h" | 19 #include "chrome/browser/policy/browser_policy_connector.h" |
20 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
21 #include "chrome/common/chrome_version_info.h" | 21 #include "chrome/common/chrome_version_info.h" |
22 #include "googleurl/src/gurl.h" | 22 #include "googleurl/src/gurl.h" |
23 #include "grit/chromium_strings.h" | 23 #include "grit/chromium_strings.h" |
24 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
25 #include "grit/theme_resources.h" | 25 #include "grit/theme_resources.h" |
26 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" | 26 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" |
27 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
28 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
29 | 29 |
30 #if defined(TOOLKIT_USES_GTK) | 30 #if defined(TOOLKIT_USES_GTK) |
31 #include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h" | 31 #include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h" |
32 #endif | 32 #endif |
33 | 33 |
34 namespace chromeos { | 34 namespace chromeos { |
35 | 35 |
36 /////////////////////////////////////////////////////////////////////////////// | 36 /////////////////////////////////////////////////////////////////////////////// |
37 // VersionInfoUpdater public: | 37 // VersionInfoUpdater public: |
38 | 38 |
39 VersionInfoUpdater::VersionInfoUpdater(Delegate* delegate) | 39 VersionInfoUpdater::VersionInfoUpdater(Delegate* delegate) |
40 : delegate_(delegate) { | 40 : delegate_(delegate) { |
41 } | 41 } |
42 | 42 |
43 VersionInfoUpdater::~VersionInfoUpdater() { | 43 VersionInfoUpdater::~VersionInfoUpdater() { |
44 } | 44 } |
45 | 45 |
46 void VersionInfoUpdater::StartUpdate(bool is_official_build) { | 46 void VersionInfoUpdater::StartUpdate(bool is_official_build) { |
47 if (system::runtime_environment::IsRunningOnChromeOS()) { | 47 if (base::chromeos::IsRunningOnChromeOS()) { |
48 version_loader_.GetVersion( | 48 version_loader_.GetVersion( |
49 &version_consumer_, | 49 &version_consumer_, |
50 base::Bind(&VersionInfoUpdater::OnVersion, base::Unretained(this)), | 50 base::Bind(&VersionInfoUpdater::OnVersion, base::Unretained(this)), |
51 is_official_build ? | 51 is_official_build ? |
52 VersionLoader::VERSION_SHORT_WITH_DATE : | 52 VersionLoader::VERSION_SHORT_WITH_DATE : |
53 VersionLoader::VERSION_FULL); | 53 VersionLoader::VERSION_FULL); |
54 boot_times_loader_.GetBootTimes( | 54 boot_times_loader_.GetBootTimes( |
55 &boot_times_consumer_, | 55 &boot_times_consumer_, |
56 base::Bind(is_official_build ? &VersionInfoUpdater::OnBootTimesNoop : | 56 base::Bind(is_official_build ? &VersionInfoUpdater::OnBootTimesNoop : |
57 &VersionInfoUpdater::OnBootTimes, | 57 &VersionInfoUpdater::OnBootTimes, |
(...skipping 19 matching lines...) Expand all Loading... |
77 UpdateEnterpriseInfo(); | 77 UpdateEnterpriseInfo(); |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 void VersionInfoUpdater::UpdateVersionLabel() { | 81 void VersionInfoUpdater::UpdateVersionLabel() { |
82 #if defined(USE_AURA) | 82 #if defined(USE_AURA) |
83 // Suffix added to the version string on Aura builds. | 83 // Suffix added to the version string on Aura builds. |
84 const char *kAuraSuffix = " Aura"; | 84 const char *kAuraSuffix = " Aura"; |
85 #endif | 85 #endif |
86 | 86 |
87 if (!system::runtime_environment::IsRunningOnChromeOS()) { | 87 if (!base::chromeos::IsRunningOnChromeOS()) { |
88 if (delegate_) { | 88 if (delegate_) { |
89 delegate_->OnOSVersionLabelTextUpdated( | 89 delegate_->OnOSVersionLabelTextUpdated( |
90 CrosLibrary::Get()->load_error_string()); | 90 CrosLibrary::Get()->load_error_string()); |
91 } | 91 } |
92 return; | 92 return; |
93 } | 93 } |
94 | 94 |
95 if (version_text_.empty()) | 95 if (version_text_.empty()) |
96 return; | 96 return; |
97 | 97 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 delegate_->OnBootTimesLabelTextUpdated(boot_times_text); | 221 delegate_->OnBootTimesLabelTextUpdated(boot_times_text); |
222 } | 222 } |
223 | 223 |
224 void VersionInfoUpdater::OnPolicyStateChanged( | 224 void VersionInfoUpdater::OnPolicyStateChanged( |
225 policy::CloudPolicySubsystem::PolicySubsystemState state, | 225 policy::CloudPolicySubsystem::PolicySubsystemState state, |
226 policy::CloudPolicySubsystem::ErrorDetails error_details) { | 226 policy::CloudPolicySubsystem::ErrorDetails error_details) { |
227 UpdateEnterpriseInfo(); | 227 UpdateEnterpriseInfo(); |
228 } | 228 } |
229 | 229 |
230 } // namespace chromeos | 230 } // namespace chromeos |
OLD | NEW |