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) { |
James Hawkins
2012/02/28 16:45:33
nit: Fix parameter alignment.
Patrick Dubroy
2012/03/15 14:31:17
Done.
| |
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 | |
Nikita (slow)
2012/02/28 09:45:33
nit: Comment about sending empty enterprise info s
Patrick Dubroy
2012/03/15 14:31:17
Done.
| |
175 // message, which indicates that the message should not be shown. | |
176 if (!domain_name.empty()) { | |
177 enterprise_info = l10n_util::GetStringFUTF8( | |
178 IDS_LOGIN_MANAGED_BY_NOTICE, | |
179 UTF8ToUTF16(enterprise_domain_text_)); | |
180 delegate_->OnEnterpriseInfoUpdated(enterprise_info); | |
181 } | |
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 |