ProfilePolicyConnectorFactory: Refactoring from Profile to BrowserContext.
[chromium-blink-merge.git] / ash / system / tray / default_system_tray_delegate.cc
blobd2564d048c0fac1c932095e674f98c7c3ff42bf0
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
3 // found in the LICENSE file.
5 #include "ash/system/tray/default_system_tray_delegate.h"
7 #include <string>
9 #include "ash/networking_config_delegate.h"
10 #include "ash/session/session_state_delegate.h"
11 #include "ash/shell.h"
12 #include "ash/volume_control_delegate.h"
13 #include "base/message_loop/message_loop.h"
14 #include "base/time/time.h"
16 namespace ash {
18 namespace {
20 class DefaultVolumnControlDelegate : public VolumeControlDelegate {
21 public:
22 DefaultVolumnControlDelegate() {}
23 ~DefaultVolumnControlDelegate() override {}
25 void HandleVolumeMute(const ui::Accelerator& accelerator) override {}
26 void HandleVolumeDown(const ui::Accelerator& accelerator) override {}
27 void HandleVolumeUp(const ui::Accelerator& accelerator) override {}
29 private:
30 DISALLOW_COPY_AND_ASSIGN(DefaultVolumnControlDelegate);
33 } // namespace
35 DefaultSystemTrayDelegate::DefaultSystemTrayDelegate()
36 : bluetooth_enabled_(true),
37 volume_control_delegate_(new DefaultVolumnControlDelegate) {
40 DefaultSystemTrayDelegate::~DefaultSystemTrayDelegate() {
43 void DefaultSystemTrayDelegate::Initialize() {
46 void DefaultSystemTrayDelegate::Shutdown() {
49 bool DefaultSystemTrayDelegate::GetTrayVisibilityOnStartup() {
50 return true;
53 user::LoginStatus DefaultSystemTrayDelegate::GetUserLoginStatus() const {
54 return user::LOGGED_IN_USER;
57 void DefaultSystemTrayDelegate::ChangeProfilePicture() {
60 const std::string DefaultSystemTrayDelegate::GetEnterpriseDomain() const {
61 return std::string();
64 const base::string16 DefaultSystemTrayDelegate::GetEnterpriseMessage() const {
65 return base::string16();
68 const std::string
69 DefaultSystemTrayDelegate::GetSupervisedUserManager() const {
70 if (!IsUserSupervised())
71 return std::string();
72 return "manager@chrome.com";
75 const base::string16
76 DefaultSystemTrayDelegate::GetSupervisedUserManagerName()
77 const {
78 return base::string16();
81 const base::string16 DefaultSystemTrayDelegate::GetSupervisedUserMessage()
82 const {
83 return base::string16();
86 bool DefaultSystemTrayDelegate::IsUserSupervised() const {
87 return GetUserLoginStatus() == ash::user::LOGGED_IN_SUPERVISED;
90 bool DefaultSystemTrayDelegate::IsUserChild() const {
91 return false;
94 void DefaultSystemTrayDelegate::GetSystemUpdateInfo(UpdateInfo* info) const {
95 DCHECK(info);
96 info->severity = UpdateInfo::UPDATE_NORMAL;
97 info->update_required = true;
98 info->factory_reset_required = false;
101 base::HourClockType DefaultSystemTrayDelegate::GetHourClockType() const {
102 return base::k24HourClock;
105 void DefaultSystemTrayDelegate::ShowSettings() {
108 bool DefaultSystemTrayDelegate::ShouldShowSettings() {
109 return true;
112 void DefaultSystemTrayDelegate::ShowDateSettings() {
115 void DefaultSystemTrayDelegate::ShowSetTimeDialog() {
118 void DefaultSystemTrayDelegate::ShowNetworkSettings(
119 const std::string& service_path) {
122 void DefaultSystemTrayDelegate::ShowBluetoothSettings() {
125 void DefaultSystemTrayDelegate::ShowDisplaySettings() {
128 void DefaultSystemTrayDelegate::ShowChromeSlow() {
131 bool DefaultSystemTrayDelegate::ShouldShowDisplayNotification() {
132 return false;
135 void DefaultSystemTrayDelegate::ShowIMESettings() {
138 void DefaultSystemTrayDelegate::ShowHelp() {
141 void DefaultSystemTrayDelegate::ShowAccessibilityHelp() {
144 void DefaultSystemTrayDelegate::ShowAccessibilitySettings() {
147 void DefaultSystemTrayDelegate::ShowPublicAccountInfo() {
150 void DefaultSystemTrayDelegate::ShowEnterpriseInfo() {
153 void DefaultSystemTrayDelegate::ShowSupervisedUserInfo() {
156 void DefaultSystemTrayDelegate::ShowUserLogin() {
159 void DefaultSystemTrayDelegate::SignOut() {
162 void DefaultSystemTrayDelegate::RequestLockScreen() {
165 void DefaultSystemTrayDelegate::RequestRestartForUpdate() {
168 void DefaultSystemTrayDelegate::GetAvailableBluetoothDevices(
169 BluetoothDeviceList* list) {
172 void DefaultSystemTrayDelegate::BluetoothStartDiscovering() {
175 void DefaultSystemTrayDelegate::BluetoothStopDiscovering() {
178 void DefaultSystemTrayDelegate::ConnectToBluetoothDevice(
179 const std::string& address) {
182 void DefaultSystemTrayDelegate::GetCurrentIME(IMEInfo* info) {
185 void DefaultSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) {
188 void DefaultSystemTrayDelegate::GetCurrentIMEProperties(
189 IMEPropertyInfoList* list) {
192 void DefaultSystemTrayDelegate::SwitchIME(const std::string& ime_id) {
195 void DefaultSystemTrayDelegate::ActivateIMEProperty(const std::string& key) {
198 void DefaultSystemTrayDelegate::ManageBluetoothDevices() {
201 void DefaultSystemTrayDelegate::ToggleBluetooth() {
202 bluetooth_enabled_ = !bluetooth_enabled_;
205 bool DefaultSystemTrayDelegate::IsBluetoothDiscovering() {
206 return false;
209 void DefaultSystemTrayDelegate::ShowOtherNetworkDialog(
210 const std::string& type) {
213 bool DefaultSystemTrayDelegate::GetBluetoothAvailable() {
214 return true;
217 bool DefaultSystemTrayDelegate::GetBluetoothEnabled() {
218 return bluetooth_enabled_;
221 bool DefaultSystemTrayDelegate::GetBluetoothDiscovering() {
222 return false;
225 void DefaultSystemTrayDelegate::ChangeProxySettings() {
228 NetworkingConfigDelegate*
229 DefaultSystemTrayDelegate::GetNetworkingConfigDelegate() const {
230 return nullptr;
233 VolumeControlDelegate* DefaultSystemTrayDelegate::GetVolumeControlDelegate()
234 const {
235 return volume_control_delegate_.get();
238 void DefaultSystemTrayDelegate::SetVolumeControlDelegate(
239 scoped_ptr<VolumeControlDelegate> delegate) {
240 volume_control_delegate_ = delegate.Pass();
243 bool DefaultSystemTrayDelegate::GetSessionStartTime(
244 base::TimeTicks* session_start_time) {
245 return false;
248 bool DefaultSystemTrayDelegate::GetSessionLengthLimit(
249 base::TimeDelta* session_length_limit) {
250 return false;
253 int DefaultSystemTrayDelegate::GetSystemTrayMenuWidth() {
254 // This is the default width for English languages.
255 return 300;
258 void DefaultSystemTrayDelegate::ActiveUserWasChanged() {
261 bool DefaultSystemTrayDelegate::IsSearchKeyMappedToCapsLock() {
262 return false;
265 tray::UserAccountsDelegate* DefaultSystemTrayDelegate::GetUserAccountsDelegate(
266 const std::string& user_id) {
267 return NULL;
270 void DefaultSystemTrayDelegate::AddCustodianInfoTrayObserver(
271 CustodianInfoTrayObserver* observer) {
274 void DefaultSystemTrayDelegate::RemoveCustodianInfoTrayObserver(
275 CustodianInfoTrayObserver* observer) {
278 void DefaultSystemTrayDelegate::AddShutdownPolicyObserver(
279 ShutdownPolicyObserver* observer) {
282 void DefaultSystemTrayDelegate::RemoveShutdownPolicyObserver(
283 ShutdownPolicyObserver* observer) {
286 void DefaultSystemTrayDelegate::ShouldRebootOnShutdown(
287 const RebootOnShutdownCallback& callback) {
290 } // namespace ash