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 "ash/strings/grit/ash_strings.h" | 9 #include "ash/strings/grit/ash_strings.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 55 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
56 policy::DeviceCloudPolicyManagerChromeOS* policy_manager = | 56 policy::DeviceCloudPolicyManagerChromeOS* policy_manager = |
57 connector->GetDeviceCloudPolicyManager(); | 57 connector->GetDeviceCloudPolicyManager(); |
58 if (policy_manager) | 58 if (policy_manager) |
59 policy_manager->core()->store()->RemoveObserver(this); | 59 policy_manager->core()->store()->RemoveObserver(this); |
60 } | 60 } |
61 | 61 |
62 void VersionInfoUpdater::StartUpdate(bool is_official_build) { | 62 void VersionInfoUpdater::StartUpdate(bool is_official_build) { |
63 if (base::SysInfo::IsRunningOnChromeOS()) { | 63 if (base::SysInfo::IsRunningOnChromeOS()) { |
64 base::PostTaskWithTraitsAndReplyWithResult( | 64 base::PostTaskWithTraitsAndReplyWithResult( |
65 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( | 65 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
66 base::TaskPriority::BACKGROUND), | |
67 base::Bind(&version_loader::GetVersion, | 66 base::Bind(&version_loader::GetVersion, |
68 is_official_build ? version_loader::VERSION_SHORT_WITH_DATE | 67 is_official_build ? version_loader::VERSION_SHORT_WITH_DATE |
69 : version_loader::VERSION_FULL), | 68 : version_loader::VERSION_FULL), |
70 base::Bind(&VersionInfoUpdater::OnVersion, | 69 base::Bind(&VersionInfoUpdater::OnVersion, |
71 weak_pointer_factory_.GetWeakPtr())); | 70 weak_pointer_factory_.GetWeakPtr())); |
72 } else { | 71 } else { |
73 UpdateVersionLabel(); | 72 UpdateVersionLabel(); |
74 } | 73 } |
75 | 74 |
76 policy::BrowserPolicyConnectorChromeOS* connector = | 75 policy::BrowserPolicyConnectorChromeOS* connector = |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 148 |
150 void VersionInfoUpdater::OnStoreLoaded(policy::CloudPolicyStore* store) { | 149 void VersionInfoUpdater::OnStoreLoaded(policy::CloudPolicyStore* store) { |
151 UpdateEnterpriseInfo(); | 150 UpdateEnterpriseInfo(); |
152 } | 151 } |
153 | 152 |
154 void VersionInfoUpdater::OnStoreError(policy::CloudPolicyStore* store) { | 153 void VersionInfoUpdater::OnStoreError(policy::CloudPolicyStore* store) { |
155 UpdateEnterpriseInfo(); | 154 UpdateEnterpriseInfo(); |
156 } | 155 } |
157 | 156 |
158 } // namespace chromeos | 157 } // namespace chromeos |
OLD | NEW |