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"
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"
18 DefaultSystemTrayDelegate::DefaultSystemTrayDelegate()
19 : bluetooth_enabled_(true) {
22 DefaultSystemTrayDelegate::~DefaultSystemTrayDelegate() {
25 bool DefaultSystemTrayDelegate::GetTrayVisibilityOnStartup() {
29 user::LoginStatus
DefaultSystemTrayDelegate::GetUserLoginStatus() const {
30 return user::LOGGED_IN_USER
;
33 const std::string
DefaultSystemTrayDelegate::GetSupervisedUserManager() const {
34 if (!IsUserSupervised())
36 return "manager@chrome.com";
39 bool DefaultSystemTrayDelegate::IsUserSupervised() const {
40 return GetUserLoginStatus() == ash::user::LOGGED_IN_SUPERVISED
;
43 void DefaultSystemTrayDelegate::GetSystemUpdateInfo(UpdateInfo
* info
) const {
45 info
->severity
= UpdateInfo::UPDATE_NORMAL
;
46 info
->update_required
= true;
47 info
->factory_reset_required
= false;
50 bool DefaultSystemTrayDelegate::ShouldShowSettings() {
54 bool DefaultSystemTrayDelegate::ShouldShowDisplayNotification() {
58 void DefaultSystemTrayDelegate::ToggleBluetooth() {
59 bluetooth_enabled_
= !bluetooth_enabled_
;
62 bool DefaultSystemTrayDelegate::IsBluetoothDiscovering() {
66 bool DefaultSystemTrayDelegate::GetBluetoothAvailable() {
70 bool DefaultSystemTrayDelegate::GetBluetoothEnabled() {
71 return bluetooth_enabled_
;
74 bool DefaultSystemTrayDelegate::GetBluetoothDiscovering() {
78 VolumeControlDelegate
* DefaultSystemTrayDelegate::GetVolumeControlDelegate()
80 return volume_control_delegate_
.get();
83 void DefaultSystemTrayDelegate::SetVolumeControlDelegate(
84 scoped_ptr
<VolumeControlDelegate
> delegate
) {
85 volume_control_delegate_
= delegate
.Pass();
88 int DefaultSystemTrayDelegate::GetSystemTrayMenuWidth() {
89 // This is the default width for English languages.