Chromium Code Reviews| Index: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
| diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
| index 2e3eb6aa00e0111eac6378ff9aa4e5415db98eab..0f745fb444fc22321e598672ce38a38d39a6b7ae 100644 |
| --- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
| +++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
| @@ -254,17 +254,10 @@ std::string SystemTrayDelegateChromeOS::GetEnterpriseDomain() const { |
| return enterprise_domain_; |
| } |
| -std::string SystemTrayDelegateChromeOS::GetEnterpriseRealm() const { |
| - return enterprise_realm_; |
| -} |
| - |
| base::string16 SystemTrayDelegateChromeOS::GetEnterpriseMessage() const { |
| - if (!GetEnterpriseRealm().empty()) { |
| - // TODO(rsorokin): Maybe change a message for the Active Directory devices. |
| - return l10n_util::GetStringFUTF16(IDS_DEVICE_OWNED_BY_NOTICE, |
| - base::UTF8ToUTF16(GetEnterpriseRealm())); |
| - } |
| - if (!GetEnterpriseDomain().empty()) { |
| + if (is_active_directory_managed_) { |
| + return l10n_util::GetStringUTF16(IDS_DEVICE_OWNED_BY_AD_NOTICE); |
| + } else if (!GetEnterpriseDomain().empty()) { |
| return l10n_util::GetStringFUTF16(IDS_DEVICE_OWNED_BY_NOTICE, |
| base::UTF8ToUTF16(GetEnterpriseDomain())); |
| } |
| @@ -870,14 +863,17 @@ void SystemTrayDelegateChromeOS::OnStartBluetoothDiscoverySession( |
| void SystemTrayDelegateChromeOS::UpdateEnterpriseDomain() { |
| policy::BrowserPolicyConnectorChromeOS* connector = |
| g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| - std::string enterprise_domain = connector->GetEnterpriseDomain(); |
| - std::string enterprise_realm = connector->GetRealm(); |
| - if (enterprise_domain_ != enterprise_domain || |
| - enterprise_realm_ != enterprise_realm) { |
| - enterprise_domain_ = enterprise_domain; |
| - enterprise_realm_ = enterprise_realm; |
| - GetSystemTrayNotifier()->NotifyEnterpriseDomainChanged(); |
| + std::string old_enterprise_domain(std::move(enterprise_domain_)); |
| + enterprise_domain_ = connector->GetEnterpriseDomain(); |
| + bool old_is_active_directory_managed = is_active_directory_managed_; |
| + is_active_directory_managed_ = connector->IsActiveDirectoryManaged(); |
| + if (is_active_directory_managed_) { |
| + if (!old_is_active_directory_managed) |
|
oshima
2016/12/16 20:57:56
if (is_active_directory_managed && !old_is_active_
Roman Sorokin (ftl)
2016/12/19 12:03:26
Good point! Fixed. Notifying when IsActiveDirector
|
| + GetSystemTrayNotifier()->NotifyEnterpriseDomainChanged(); |
| + return; |
| } |
| + if (old_enterprise_domain != enterprise_domain_) |
| + GetSystemTrayNotifier()->NotifyEnterpriseDomainChanged(); |
| } |
| // Overridden from CloudPolicyStore::Observer |