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

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

Issue 2433363004: Chromad: added AD Join ui, authpolicy_client (Closed)
Patch Set: Adress authpolicy_client comments 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
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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 } 290 }
291 291
292 ash::LoginStatus SystemTrayDelegateChromeOS::GetUserLoginStatus() const { 292 ash::LoginStatus SystemTrayDelegateChromeOS::GetUserLoginStatus() const {
293 return SystemTrayClient::GetUserLoginStatus(); 293 return SystemTrayClient::GetUserLoginStatus();
294 } 294 }
295 295
296 std::string SystemTrayDelegateChromeOS::GetEnterpriseDomain() const { 296 std::string SystemTrayDelegateChromeOS::GetEnterpriseDomain() const {
297 return enterprise_domain_; 297 return enterprise_domain_;
298 } 298 }
299 299
300 std::string SystemTrayDelegateChromeOS::GetEnterpriseRealm() const {
301 return enterprise_realm_;
302 }
303
300 base::string16 SystemTrayDelegateChromeOS::GetEnterpriseMessage() const { 304 base::string16 SystemTrayDelegateChromeOS::GetEnterpriseMessage() const {
301 if (GetEnterpriseDomain().empty()) 305 if (!GetEnterpriseRealm().empty()) {
302 return base::string16(); 306 return l10n_util::GetStringFUTF16(IDS_DEVICE_PART_OF_DOMAIN_NOTICE,
303 return l10n_util::GetStringFUTF16(IDS_DEVICE_OWNED_BY_NOTICE, 307 base::UTF8ToUTF16(GetEnterpriseRealm()));
304 base::UTF8ToUTF16(GetEnterpriseDomain())); 308 }
309 if (!GetEnterpriseDomain().empty()) {
310 return l10n_util::GetStringFUTF16(IDS_DEVICE_OWNED_BY_NOTICE,
311 base::UTF8ToUTF16(GetEnterpriseDomain()));
312 }
313 return base::string16();
305 } 314 }
306 315
307 std::string SystemTrayDelegateChromeOS::GetSupervisedUserManager() const { 316 std::string SystemTrayDelegateChromeOS::GetSupervisedUserManager() const {
308 if (!IsUserSupervised()) 317 if (!IsUserSupervised())
309 return std::string(); 318 return std::string();
310 return SupervisedUserServiceFactory::GetForProfile(user_profile_)-> 319 return SupervisedUserServiceFactory::GetForProfile(user_profile_)->
311 GetCustodianEmailAddress(); 320 GetCustodianEmailAddress();
312 } 321 }
313 322
314 base::string16 323 base::string16
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 return; 1011 return;
1003 VLOG(1) << "Claiming new Bluetooth device discovery session."; 1012 VLOG(1) << "Claiming new Bluetooth device discovery session.";
1004 bluetooth_discovery_session_ = std::move(discovery_session); 1013 bluetooth_discovery_session_ = std::move(discovery_session);
1005 GetSystemTrayNotifier()->NotifyBluetoothDiscoveringChanged(); 1014 GetSystemTrayNotifier()->NotifyBluetoothDiscoveringChanged();
1006 } 1015 }
1007 1016
1008 void SystemTrayDelegateChromeOS::UpdateEnterpriseDomain() { 1017 void SystemTrayDelegateChromeOS::UpdateEnterpriseDomain() {
1009 policy::BrowserPolicyConnectorChromeOS* connector = 1018 policy::BrowserPolicyConnectorChromeOS* connector =
1010 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 1019 g_browser_process->platform_part()->browser_policy_connector_chromeos();
1011 std::string enterprise_domain = connector->GetEnterpriseDomain(); 1020 std::string enterprise_domain = connector->GetEnterpriseDomain();
1012 if (enterprise_domain_ != enterprise_domain) { 1021 std::string enterprise_realm = connector->GetRealm();
1022 if (enterprise_domain_ != enterprise_domain ||
1023 enterprise_realm_ != enterprise_realm) {
1013 enterprise_domain_ = enterprise_domain; 1024 enterprise_domain_ = enterprise_domain;
1025 enterprise_realm_ = enterprise_realm;
1014 GetSystemTrayNotifier()->NotifyEnterpriseDomainChanged(); 1026 GetSystemTrayNotifier()->NotifyEnterpriseDomainChanged();
1015 } 1027 }
1016 } 1028 }
1017 1029
1018 // Overridden from CloudPolicyStore::Observer 1030 // Overridden from CloudPolicyStore::Observer
1019 void SystemTrayDelegateChromeOS::OnStoreLoaded( 1031 void SystemTrayDelegateChromeOS::OnStoreLoaded(
1020 policy::CloudPolicyStore* store) { 1032 policy::CloudPolicyStore* store) {
1021 UpdateEnterpriseDomain(); 1033 UpdateEnterpriseDomain();
1022 } 1034 }
1023 1035
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " 1123 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while "
1112 << "ENABLE_SUPERVISED_USERS undefined."; 1124 << "ENABLE_SUPERVISED_USERS undefined.";
1113 return base::string16(); 1125 return base::string16();
1114 } 1126 }
1115 1127
1116 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1128 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1117 return new SystemTrayDelegateChromeOS(); 1129 return new SystemTrayDelegateChromeOS();
1118 } 1130 }
1119 1131
1120 } // namespace chromeos 1132 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698