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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 case policy::CloudPolicySubsystem::TOKEN_FETCHED: | 154 case policy::CloudPolicySubsystem::TOKEN_FETCHED: |
155 case policy::CloudPolicySubsystem::SUCCESS: | 155 case policy::CloudPolicySubsystem::SUCCESS: |
156 break; | 156 break; |
157 } | 157 } |
158 } | 158 } |
159 | 159 |
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 if (!domain_name.empty()) { |
| 175 enterprise_info = l10n_util::GetStringFUTF8( |
| 176 IDS_LOGIN_MANAGED_BY_NOTICE, |
| 177 UTF8ToUTF16(enterprise_domain_text_)); |
| 178 delegate_->OnEnterpriseInfoUpdated(enterprise_info); |
| 179 } |
| 180 } |
170 } | 181 } |
171 } | 182 } |
172 | 183 |
173 void VersionInfoUpdater::OnVersion( | 184 void VersionInfoUpdater::OnVersion( |
174 VersionLoader::Handle handle, std::string version) { | 185 VersionLoader::Handle handle, std::string version) { |
175 version_text_.swap(version); | 186 version_text_.swap(version); |
176 UpdateVersionLabel(); | 187 UpdateVersionLabel(); |
177 } | 188 } |
178 | 189 |
179 void VersionInfoUpdater::OnBootTimesNoop( | 190 void VersionInfoUpdater::OnBootTimesNoop( |
(...skipping 30 matching lines...) Expand all Loading... |
210 delegate_->OnBootTimesLabelTextUpdated(boot_times_text); | 221 delegate_->OnBootTimesLabelTextUpdated(boot_times_text); |
211 } | 222 } |
212 | 223 |
213 void VersionInfoUpdater::OnPolicyStateChanged( | 224 void VersionInfoUpdater::OnPolicyStateChanged( |
214 policy::CloudPolicySubsystem::PolicySubsystemState state, | 225 policy::CloudPolicySubsystem::PolicySubsystemState state, |
215 policy::CloudPolicySubsystem::ErrorDetails error_details) { | 226 policy::CloudPolicySubsystem::ErrorDetails error_details) { |
216 UpdateEnterpriseInfo(); | 227 UpdateEnterpriseInfo(); |
217 } | 228 } |
218 | 229 |
219 } // namespace chromeos | 230 } // namespace chromeos |
OLD | NEW |