Chromium Code Reviews| 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" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 SetEnterpriseInfo(policy_connector->GetEnterpriseDomain(), status_text); | 160 SetEnterpriseInfo(policy_connector->GetEnterpriseDomain(), status_text); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void VersionInfoUpdater::SetEnterpriseInfo(const std::string& domain_name, | 163 void VersionInfoUpdater::SetEnterpriseInfo(const std::string& domain_name, |
| 164 const std::string& status_text) { | 164 const std::string& status_text) { |
| 165 if (domain_name != enterprise_domain_text_ || | 165 if (domain_name != enterprise_domain_text_ || |
| 166 status_text != enterprise_status_text_) { | 166 status_text != enterprise_status_text_) { |
| 167 enterprise_domain_text_ = domain_name; | 167 enterprise_domain_text_ = domain_name; |
| 168 enterprise_status_text_ = status_text; | 168 enterprise_status_text_ = status_text; |
| 169 UpdateVersionLabel(); | 169 UpdateVersionLabel(); |
| 170 | |
| 171 // Update the notification about device status reporting. | |
| 172 if (delegate_) { | |
| 173 std::string enterprise_info; | |
| 174 // When there is no managed domain, send an empty enterprise info | |
| 175 // message, which indicates that the message should not be shown. | |
|
Nikita (slow)
2012/02/23 14:58:51
We could as well not call OnEnterpriseInfoUpdated(
Patrick Dubroy
2012/02/28 00:51:02
Done.
| |
| 176 if (!domain_name.empty()) { | |
| 177 enterprise_info = l10n_util::GetStringFUTF8( | |
| 178 IDS_LOGIN_MANAGED_BY_NOTICE, | |
| 179 UTF8ToUTF16(enterprise_domain_text_)); | |
| 180 } | |
| 181 delegate_->OnEnterpriseInfoUpdated(enterprise_info); | |
| 182 } | |
| 170 } | 183 } |
| 171 } | 184 } |
| 172 | 185 |
| 173 void VersionInfoUpdater::OnVersion( | 186 void VersionInfoUpdater::OnVersion( |
| 174 VersionLoader::Handle handle, std::string version) { | 187 VersionLoader::Handle handle, std::string version) { |
| 175 version_text_.swap(version); | 188 version_text_.swap(version); |
| 176 UpdateVersionLabel(); | 189 UpdateVersionLabel(); |
| 177 } | 190 } |
| 178 | 191 |
| 179 void VersionInfoUpdater::OnBootTimesNoop( | 192 void VersionInfoUpdater::OnBootTimesNoop( |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 210 delegate_->OnBootTimesLabelTextUpdated(boot_times_text); | 223 delegate_->OnBootTimesLabelTextUpdated(boot_times_text); |
| 211 } | 224 } |
| 212 | 225 |
| 213 void VersionInfoUpdater::OnPolicyStateChanged( | 226 void VersionInfoUpdater::OnPolicyStateChanged( |
| 214 policy::CloudPolicySubsystem::PolicySubsystemState state, | 227 policy::CloudPolicySubsystem::PolicySubsystemState state, |
| 215 policy::CloudPolicySubsystem::ErrorDetails error_details) { | 228 policy::CloudPolicySubsystem::ErrorDetails error_details) { |
| 216 UpdateEnterpriseInfo(); | 229 UpdateEnterpriseInfo(); |
| 217 } | 230 } |
| 218 | 231 |
| 219 } // namespace chromeos | 232 } // namespace chromeos |
| OLD | NEW |