| OLD | NEW |
| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #include "chrome/browser/ui/ash/system_tray_client.h" | 71 #include "chrome/browser/ui/ash/system_tray_client.h" |
| 72 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h" | 72 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h" |
| 73 #include "chrome/browser/ui/ash/vpn_delegate_chromeos.h" | 73 #include "chrome/browser/ui/ash/vpn_delegate_chromeos.h" |
| 74 #include "chrome/browser/ui/browser.h" | 74 #include "chrome/browser/ui/browser.h" |
| 75 #include "chrome/browser/ui/browser_list.h" | 75 #include "chrome/browser/ui/browser_list.h" |
| 76 #include "chrome/browser/ui/chrome_pages.h" | 76 #include "chrome/browser/ui/chrome_pages.h" |
| 77 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 77 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 78 #include "chrome/browser/ui/singleton_tabs.h" | 78 #include "chrome/browser/ui/singleton_tabs.h" |
| 79 #include "chrome/browser/upgrade_detector.h" | 79 #include "chrome/browser/upgrade_detector.h" |
| 80 #include "chrome/common/chrome_switches.h" | 80 #include "chrome/common/chrome_switches.h" |
| 81 #include "chrome/common/features.h" |
| 81 #include "chrome/common/pref_names.h" | 82 #include "chrome/common/pref_names.h" |
| 82 #include "chrome/common/url_constants.h" | 83 #include "chrome/common/url_constants.h" |
| 83 #include "chrome/grit/generated_resources.h" | 84 #include "chrome/grit/generated_resources.h" |
| 84 #include "chrome/grit/locale_settings.h" | 85 #include "chrome/grit/locale_settings.h" |
| 85 #include "chromeos/dbus/dbus_thread_manager.h" | 86 #include "chromeos/dbus/dbus_thread_manager.h" |
| 86 #include "chromeos/dbus/session_manager_client.h" | 87 #include "chromeos/dbus/session_manager_client.h" |
| 87 #include "chromeos/login/login_state.h" | 88 #include "chromeos/login/login_state.h" |
| 88 #include "chromeos/network/portal_detector/network_portal_detector.h" | 89 #include "chromeos/network/portal_detector/network_portal_detector.h" |
| 89 #include "components/google/core/browser/google_util.h" | 90 #include "components/google/core/browser/google_util.h" |
| 90 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 91 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
| 91 #include "components/prefs/pref_service.h" | 92 #include "components/prefs/pref_service.h" |
| 92 #include "components/user_manager/user.h" | 93 #include "components/user_manager/user.h" |
| 93 #include "components/user_manager/user_manager.h" | 94 #include "components/user_manager/user_manager.h" |
| 94 #include "components/user_manager/user_type.h" | 95 #include "components/user_manager/user_type.h" |
| 95 #include "content/public/browser/notification_observer.h" | 96 #include "content/public/browser/notification_observer.h" |
| 96 #include "content/public/browser/notification_service.h" | 97 #include "content/public/browser/notification_service.h" |
| 97 #include "content/public/browser/user_metrics.h" | 98 #include "content/public/browser/user_metrics.h" |
| 98 #include "device/bluetooth/bluetooth_adapter.h" | 99 #include "device/bluetooth/bluetooth_adapter.h" |
| 99 #include "device/bluetooth/bluetooth_adapter_factory.h" | 100 #include "device/bluetooth/bluetooth_adapter_factory.h" |
| 100 #include "device/bluetooth/bluetooth_device.h" | 101 #include "device/bluetooth/bluetooth_device.h" |
| 101 #include "ui/base/ime/chromeos/extension_ime_util.h" | 102 #include "ui/base/ime/chromeos/extension_ime_util.h" |
| 102 #include "ui/base/ime/chromeos/ime_keyboard.h" | 103 #include "ui/base/ime/chromeos/ime_keyboard.h" |
| 103 #include "ui/base/ime/chromeos/input_method_manager.h" | 104 #include "ui/base/ime/chromeos/input_method_manager.h" |
| 104 #include "ui/base/l10n/l10n_util.h" | 105 #include "ui/base/l10n/l10n_util.h" |
| 105 #include "ui/base/l10n/time_format.h" | 106 #include "ui/base/l10n/time_format.h" |
| 106 #include "ui/chromeos/ime/input_method_menu_item.h" | 107 #include "ui/chromeos/ime/input_method_menu_item.h" |
| 107 #include "ui/chromeos/ime/input_method_menu_manager.h" | 108 #include "ui/chromeos/ime/input_method_menu_manager.h" |
| 108 | 109 |
| 109 #if defined(ENABLE_SUPERVISED_USERS) | 110 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
| 110 #include "chrome/browser/supervised_user/supervised_user_service.h" | 111 #include "chrome/browser/supervised_user/supervised_user_service.h" |
| 111 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 112 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
| 112 #endif | 113 #endif |
| 113 | 114 |
| 114 namespace chromeos { | 115 namespace chromeos { |
| 115 | 116 |
| 116 namespace { | 117 namespace { |
| 117 | 118 |
| 118 // The minimum session length limit that can be set. | 119 // The minimum session length limit that can be set. |
| 119 const int kSessionLengthLimitMinMs = 30 * 1000; // 30 seconds. | 120 const int kSessionLengthLimitMinMs = 30 * 1000; // 30 seconds. |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 const base::string16 | 1047 const base::string16 |
| 1047 SystemTrayDelegateChromeOS::GetLegacySupervisedUserMessage() const { | 1048 SystemTrayDelegateChromeOS::GetLegacySupervisedUserMessage() const { |
| 1048 std::string user_manager_name = GetSupervisedUserManager(); | 1049 std::string user_manager_name = GetSupervisedUserManager(); |
| 1049 return l10n_util::GetStringFUTF16( | 1050 return l10n_util::GetStringFUTF16( |
| 1050 IDS_USER_IS_SUPERVISED_BY_NOTICE, | 1051 IDS_USER_IS_SUPERVISED_BY_NOTICE, |
| 1051 base::UTF8ToUTF16(user_manager_name)); | 1052 base::UTF8ToUTF16(user_manager_name)); |
| 1052 } | 1053 } |
| 1053 | 1054 |
| 1054 const base::string16 | 1055 const base::string16 |
| 1055 SystemTrayDelegateChromeOS::GetChildUserMessage() const { | 1056 SystemTrayDelegateChromeOS::GetChildUserMessage() const { |
| 1056 #if defined(ENABLE_SUPERVISED_USERS) | 1057 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
| 1057 SupervisedUserService* service = | 1058 SupervisedUserService* service = |
| 1058 SupervisedUserServiceFactory::GetForProfile(user_profile_); | 1059 SupervisedUserServiceFactory::GetForProfile(user_profile_); |
| 1059 base::string16 first_custodian = | 1060 base::string16 first_custodian = |
| 1060 base::UTF8ToUTF16(service->GetCustodianEmailAddress()); | 1061 base::UTF8ToUTF16(service->GetCustodianEmailAddress()); |
| 1061 base::string16 second_custodian = | 1062 base::string16 second_custodian = |
| 1062 base::UTF8ToUTF16(service->GetSecondCustodianEmailAddress()); | 1063 base::UTF8ToUTF16(service->GetSecondCustodianEmailAddress()); |
| 1063 LOG_IF(WARNING, first_custodian.empty()) << | 1064 LOG_IF(WARNING, first_custodian.empty()) << |
| 1064 "Returning incomplete child user message as manager not known yet."; | 1065 "Returning incomplete child user message as manager not known yet."; |
| 1065 if (second_custodian.empty()) { | 1066 if (second_custodian.empty()) { |
| 1066 return l10n_util::GetStringFUTF16( | 1067 return l10n_util::GetStringFUTF16( |
| 1067 IDS_CHILD_USER_IS_MANAGED_BY_ONE_PARENT_NOTICE, first_custodian); | 1068 IDS_CHILD_USER_IS_MANAGED_BY_ONE_PARENT_NOTICE, first_custodian); |
| 1068 } else { | 1069 } else { |
| 1069 return l10n_util::GetStringFUTF16( | 1070 return l10n_util::GetStringFUTF16( |
| 1070 IDS_CHILD_USER_IS_MANAGED_BY_TWO_PARENTS_NOTICE, | 1071 IDS_CHILD_USER_IS_MANAGED_BY_TWO_PARENTS_NOTICE, |
| 1071 first_custodian, | 1072 first_custodian, |
| 1072 second_custodian); | 1073 second_custodian); |
| 1073 } | 1074 } |
| 1074 #endif | 1075 #endif |
| 1075 | 1076 |
| 1076 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 1077 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
| 1077 << "ENABLE_SUPERVISED_USERS undefined."; | 1078 << "ENABLE_SUPERVISED_USERS undefined."; |
| 1078 return base::string16(); | 1079 return base::string16(); |
| 1079 } | 1080 } |
| 1080 | 1081 |
| 1081 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1082 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1082 return new SystemTrayDelegateChromeOS(); | 1083 return new SystemTrayDelegateChromeOS(); |
| 1083 } | 1084 } |
| 1084 | 1085 |
| 1085 } // namespace chromeos | 1086 } // namespace chromeos |
| OLD | NEW |