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/session/session_state_delegate.h"
10 #include "ash/shell.h"
11 #include "ash/volume_control_delegate.h"
12 #include "base/message_loop/message_loop.h"
13 #include "base/time/time.h"
19 class DefaultVolumnControlDelegate : public VolumeControlDelegate {
21 DefaultVolumnControlDelegate() {}
22 virtual ~DefaultVolumnControlDelegate() {}
24 virtual bool HandleVolumeMute(const ui::Accelerator& accelerator) OVERRIDE {
27 virtual bool HandleVolumeDown(const ui::Accelerator& accelerator) OVERRIDE {
30 virtual bool HandleVolumeUp(const ui::Accelerator& accelerator) OVERRIDE {
35 DISALLOW_COPY_AND_ASSIGN(DefaultVolumnControlDelegate);
40 DefaultSystemTrayDelegate::DefaultSystemTrayDelegate()
41 : bluetooth_enabled_(true),
42 volume_control_delegate_(new DefaultVolumnControlDelegate) {
45 DefaultSystemTrayDelegate::~DefaultSystemTrayDelegate() {
48 void DefaultSystemTrayDelegate::Initialize() {
51 void DefaultSystemTrayDelegate::Shutdown() {
54 bool DefaultSystemTrayDelegate::GetTrayVisibilityOnStartup() {
58 user::LoginStatus DefaultSystemTrayDelegate::GetUserLoginStatus() const {
59 return user::LOGGED_IN_USER;
62 void DefaultSystemTrayDelegate::ChangeProfilePicture() {
65 const std::string DefaultSystemTrayDelegate::GetEnterpriseDomain() const {
69 const base::string16 DefaultSystemTrayDelegate::GetEnterpriseMessage() const {
70 return base::string16();
74 DefaultSystemTrayDelegate::GetSupervisedUserManager() const {
79 DefaultSystemTrayDelegate::GetSupervisedUserManagerName()
81 return base::string16();
84 const base::string16 DefaultSystemTrayDelegate::GetSupervisedUserMessage()
86 return base::string16();
89 bool DefaultSystemTrayDelegate::IsUserSupervised() const {
93 bool DefaultSystemTrayDelegate::SystemShouldUpgrade() const {
97 base::HourClockType DefaultSystemTrayDelegate::GetHourClockType() const {
98 return base::k24HourClock;
101 void DefaultSystemTrayDelegate::ShowSettings() {
104 bool DefaultSystemTrayDelegate::ShouldShowSettings() {
108 void DefaultSystemTrayDelegate::ShowDateSettings() {
111 void DefaultSystemTrayDelegate::ShowSetTimeDialog() {
114 void DefaultSystemTrayDelegate::ShowNetworkSettings(
115 const std::string& service_path) {
118 void DefaultSystemTrayDelegate::ShowBluetoothSettings() {
121 void DefaultSystemTrayDelegate::ShowDisplaySettings() {
124 void DefaultSystemTrayDelegate::ShowChromeSlow() {
127 bool DefaultSystemTrayDelegate::ShouldShowDisplayNotification() {
131 void DefaultSystemTrayDelegate::ShowIMESettings() {
134 void DefaultSystemTrayDelegate::ShowHelp() {
137 void DefaultSystemTrayDelegate::ShowAccessibilityHelp() {
140 void DefaultSystemTrayDelegate::ShowAccessibilitySettings() {
143 void DefaultSystemTrayDelegate::ShowPublicAccountInfo() {
146 void DefaultSystemTrayDelegate::ShowEnterpriseInfo() {
149 void DefaultSystemTrayDelegate::ShowSupervisedUserInfo() {
152 void DefaultSystemTrayDelegate::ShowUserLogin() {
155 bool DefaultSystemTrayDelegate::ShowSpringChargerReplacementDialog() {
159 bool DefaultSystemTrayDelegate::IsSpringChargerReplacementDialogVisible() {
163 bool DefaultSystemTrayDelegate::HasUserConfirmedSafeSpringCharger() {
167 void DefaultSystemTrayDelegate::ShutDown() {
170 void DefaultSystemTrayDelegate::SignOut() {
173 void DefaultSystemTrayDelegate::RequestLockScreen() {
176 void DefaultSystemTrayDelegate::RequestRestartForUpdate() {
179 void DefaultSystemTrayDelegate::GetAvailableBluetoothDevices(
180 BluetoothDeviceList* list) {
183 void DefaultSystemTrayDelegate::BluetoothStartDiscovering() {
186 void DefaultSystemTrayDelegate::BluetoothStopDiscovering() {
189 void DefaultSystemTrayDelegate::ConnectToBluetoothDevice(
190 const std::string& address) {
193 void DefaultSystemTrayDelegate::GetCurrentIME(IMEInfo* info) {
196 void DefaultSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) {
199 void DefaultSystemTrayDelegate::GetCurrentIMEProperties(
200 IMEPropertyInfoList* list) {
203 void DefaultSystemTrayDelegate::SwitchIME(const std::string& ime_id) {
206 void DefaultSystemTrayDelegate::ActivateIMEProperty(const std::string& key) {
209 void DefaultSystemTrayDelegate::ShowNetworkConfigure(
210 const std::string& network_id) {
213 bool DefaultSystemTrayDelegate::EnrollNetwork(const std::string& network_id) {
217 void DefaultSystemTrayDelegate::ManageBluetoothDevices() {
220 void DefaultSystemTrayDelegate::ToggleBluetooth() {
221 bluetooth_enabled_ = !bluetooth_enabled_;
224 bool DefaultSystemTrayDelegate::IsBluetoothDiscovering() {
228 void DefaultSystemTrayDelegate::ShowMobileSimDialog() {
231 void DefaultSystemTrayDelegate::ShowMobileSetupDialog(
232 const std::string& service_path) {
235 void DefaultSystemTrayDelegate::ShowOtherNetworkDialog(
236 const std::string& type) {
239 bool DefaultSystemTrayDelegate::GetBluetoothAvailable() {
243 bool DefaultSystemTrayDelegate::GetBluetoothEnabled() {
244 return bluetooth_enabled_;
247 bool DefaultSystemTrayDelegate::GetBluetoothDiscovering() {
251 void DefaultSystemTrayDelegate::ChangeProxySettings() {
254 VolumeControlDelegate* DefaultSystemTrayDelegate::GetVolumeControlDelegate()
256 return volume_control_delegate_.get();
259 void DefaultSystemTrayDelegate::SetVolumeControlDelegate(
260 scoped_ptr<VolumeControlDelegate> delegate) {
261 volume_control_delegate_ = delegate.Pass();
264 bool DefaultSystemTrayDelegate::GetSessionStartTime(
265 base::TimeTicks* session_start_time) {
269 bool DefaultSystemTrayDelegate::GetSessionLengthLimit(
270 base::TimeDelta* session_length_limit) {
274 int DefaultSystemTrayDelegate::GetSystemTrayMenuWidth() {
275 // This is the default width for English languages.
279 void DefaultSystemTrayDelegate::ActiveUserWasChanged() {
282 bool DefaultSystemTrayDelegate::IsSearchKeyMappedToCapsLock() {
286 tray::UserAccountsDelegate* DefaultSystemTrayDelegate::GetUserAccountsDelegate(
287 const std::string& user_id) {