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_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 bool DefaultSystemTrayDelegate::IsOobeCompleted() const {
66 void DefaultSystemTrayDelegate::ChangeProfilePicture() {
69 const std::string DefaultSystemTrayDelegate::GetEnterpriseDomain() const {
73 const base::string16 DefaultSystemTrayDelegate::GetEnterpriseMessage() const {
78 DefaultSystemTrayDelegate::GetLocallyManagedUserManager() const {
83 DefaultSystemTrayDelegate::GetLocallyManagedUserManagerName()
88 const base::string16 DefaultSystemTrayDelegate::GetLocallyManagedUserMessage()
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::ShowNetworkSettings(
112 const std::string& service_path) {
115 void DefaultSystemTrayDelegate::ShowBluetoothSettings() {
118 void DefaultSystemTrayDelegate::ShowDisplaySettings() {
121 void DefaultSystemTrayDelegate::ShowChromeSlow() {
124 bool DefaultSystemTrayDelegate::ShouldShowDisplayNotification() {
128 void DefaultSystemTrayDelegate::ShowDriveSettings() {
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::ShowLocallyManagedUserInfo() {
152 void DefaultSystemTrayDelegate::ShowUserLogin() {
155 void DefaultSystemTrayDelegate::ShutDown() {
158 void DefaultSystemTrayDelegate::SignOut() {
161 void DefaultSystemTrayDelegate::RequestLockScreen() {
164 void DefaultSystemTrayDelegate::RequestRestartForUpdate() {
167 void DefaultSystemTrayDelegate::GetAvailableBluetoothDevices(
168 BluetoothDeviceList* list) {
171 void DefaultSystemTrayDelegate::BluetoothStartDiscovering() {
174 void DefaultSystemTrayDelegate::BluetoothStopDiscovering() {
177 void DefaultSystemTrayDelegate::ConnectToBluetoothDevice(
178 const std::string& address) {
181 void DefaultSystemTrayDelegate::GetCurrentIME(IMEInfo* info) {
184 void DefaultSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) {
187 void DefaultSystemTrayDelegate::GetCurrentIMEProperties(
188 IMEPropertyInfoList* list) {
191 void DefaultSystemTrayDelegate::SwitchIME(const std::string& ime_id) {
194 void DefaultSystemTrayDelegate::ActivateIMEProperty(const std::string& key) {
197 void DefaultSystemTrayDelegate::CancelDriveOperation(int32 operation_id) {
200 void DefaultSystemTrayDelegate::GetDriveOperationStatusList(
201 ash::DriveOperationStatusList*) {
204 void DefaultSystemTrayDelegate::ShowNetworkConfigure(
205 const std::string& network_id,
206 gfx::NativeWindow parent_window) {
209 bool DefaultSystemTrayDelegate::EnrollNetwork(const std::string& network_id,
210 gfx::NativeWindow parent_window) {
214 void DefaultSystemTrayDelegate::ManageBluetoothDevices() {
217 void DefaultSystemTrayDelegate::ToggleBluetooth() {
218 bluetooth_enabled_ = !bluetooth_enabled_;
221 bool DefaultSystemTrayDelegate::IsBluetoothDiscovering() {
225 void DefaultSystemTrayDelegate::ShowMobileSimDialog() {
228 void DefaultSystemTrayDelegate::ShowMobileSetupDialog(
229 const std::string& service_path) {
232 void DefaultSystemTrayDelegate::ShowOtherNetworkDialog(
233 const std::string& type) {
236 bool DefaultSystemTrayDelegate::GetBluetoothAvailable() {
240 bool DefaultSystemTrayDelegate::GetBluetoothEnabled() {
241 return bluetooth_enabled_;
244 void DefaultSystemTrayDelegate::ChangeProxySettings() {
247 VolumeControlDelegate* DefaultSystemTrayDelegate::GetVolumeControlDelegate()
249 return volume_control_delegate_.get();
252 void DefaultSystemTrayDelegate::SetVolumeControlDelegate(
253 scoped_ptr<VolumeControlDelegate> delegate) {
254 volume_control_delegate_ = delegate.Pass();
257 bool DefaultSystemTrayDelegate::GetSessionStartTime(
258 base::TimeTicks* session_start_time) {
262 bool DefaultSystemTrayDelegate::GetSessionLengthLimit(
263 base::TimeDelta* session_length_limit) {
267 int DefaultSystemTrayDelegate::GetSystemTrayMenuWidth() {
268 // This is the default width for English languages.
272 void DefaultSystemTrayDelegate::MaybeSpeak(const std::string& utterance) const {