Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9402)

Unified Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc

Issue 2587453002: Chromad: Use different enterprise messaging in tray bubble. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698