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

Side by Side Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc

Issue 2491623003: Show realm in device owner notice (Closed)
Patch Set: rebase Created 4 years, 1 month 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/ash/system_tray_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 269 }
270 270
271 ash::LoginStatus SystemTrayDelegateChromeOS::GetUserLoginStatus() const { 271 ash::LoginStatus SystemTrayDelegateChromeOS::GetUserLoginStatus() const {
272 return SystemTrayClient::GetUserLoginStatus(); 272 return SystemTrayClient::GetUserLoginStatus();
273 } 273 }
274 274
275 std::string SystemTrayDelegateChromeOS::GetEnterpriseDomain() const { 275 std::string SystemTrayDelegateChromeOS::GetEnterpriseDomain() const {
276 return enterprise_domain_; 276 return enterprise_domain_;
277 } 277 }
278 278
279 std::string SystemTrayDelegateChromeOS::GetEnterpriseRealm() const {
280 return enterprise_realm_;
281 }
282
279 base::string16 SystemTrayDelegateChromeOS::GetEnterpriseMessage() const { 283 base::string16 SystemTrayDelegateChromeOS::GetEnterpriseMessage() const {
280 if (GetEnterpriseDomain().empty()) 284 if (!GetEnterpriseRealm().empty()) {
281 return base::string16(); 285 // TODO(rsorokin): Maybe change a message for the Active Directory devices.
282 return l10n_util::GetStringFUTF16(IDS_DEVICE_OWNED_BY_NOTICE, 286 return l10n_util::GetStringFUTF16(IDS_DEVICE_OWNED_BY_NOTICE,
283 base::UTF8ToUTF16(GetEnterpriseDomain())); 287 base::UTF8ToUTF16(GetEnterpriseRealm()));
288 }
289 if (!GetEnterpriseDomain().empty()) {
290 return l10n_util::GetStringFUTF16(IDS_DEVICE_OWNED_BY_NOTICE,
291 base::UTF8ToUTF16(GetEnterpriseDomain()));
292 }
293 return base::string16();
284 } 294 }
285 295
286 std::string SystemTrayDelegateChromeOS::GetSupervisedUserManager() const { 296 std::string SystemTrayDelegateChromeOS::GetSupervisedUserManager() const {
287 if (!IsUserSupervised()) 297 if (!IsUserSupervised())
288 return std::string(); 298 return std::string();
289 return SupervisedUserServiceFactory::GetForProfile(user_profile_)-> 299 return SupervisedUserServiceFactory::GetForProfile(user_profile_)->
290 GetCustodianEmailAddress(); 300 GetCustodianEmailAddress();
291 } 301 }
292 302
293 base::string16 303 base::string16
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 return; 967 return;
958 VLOG(1) << "Claiming new Bluetooth device discovery session."; 968 VLOG(1) << "Claiming new Bluetooth device discovery session.";
959 bluetooth_discovery_session_ = std::move(discovery_session); 969 bluetooth_discovery_session_ = std::move(discovery_session);
960 GetSystemTrayNotifier()->NotifyBluetoothDiscoveringChanged(); 970 GetSystemTrayNotifier()->NotifyBluetoothDiscoveringChanged();
961 } 971 }
962 972
963 void SystemTrayDelegateChromeOS::UpdateEnterpriseDomain() { 973 void SystemTrayDelegateChromeOS::UpdateEnterpriseDomain() {
964 policy::BrowserPolicyConnectorChromeOS* connector = 974 policy::BrowserPolicyConnectorChromeOS* connector =
965 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 975 g_browser_process->platform_part()->browser_policy_connector_chromeos();
966 std::string enterprise_domain = connector->GetEnterpriseDomain(); 976 std::string enterprise_domain = connector->GetEnterpriseDomain();
967 if (enterprise_domain_ != enterprise_domain) { 977 std::string enterprise_realm = connector->GetRealm();
978 if (enterprise_domain_ != enterprise_domain ||
979 enterprise_realm_ != enterprise_realm) {
968 enterprise_domain_ = enterprise_domain; 980 enterprise_domain_ = enterprise_domain;
981 enterprise_realm_ = enterprise_realm;
969 GetSystemTrayNotifier()->NotifyEnterpriseDomainChanged(); 982 GetSystemTrayNotifier()->NotifyEnterpriseDomainChanged();
970 } 983 }
971 } 984 }
972 985
973 // Overridden from CloudPolicyStore::Observer 986 // Overridden from CloudPolicyStore::Observer
974 void SystemTrayDelegateChromeOS::OnStoreLoaded( 987 void SystemTrayDelegateChromeOS::OnStoreLoaded(
975 policy::CloudPolicyStore* store) { 988 policy::CloudPolicyStore* store) {
976 UpdateEnterpriseDomain(); 989 UpdateEnterpriseDomain();
977 } 990 }
978 991
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " 1079 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while "
1067 << "ENABLE_SUPERVISED_USERS undefined."; 1080 << "ENABLE_SUPERVISED_USERS undefined.";
1068 return base::string16(); 1081 return base::string16();
1069 } 1082 }
1070 1083
1071 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1084 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1072 return new SystemTrayDelegateChromeOS(); 1085 return new SystemTrayDelegateChromeOS();
1073 } 1086 }
1074 1087
1075 } // namespace chromeos 1088 } // namespace chromeos
OLDNEW
« 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