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. 4 5 #include "ash/system/tray/default_system_tray_delegate.h" 6 7 #include <string> 8 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" 14 15 namespace ash { 16 17 namespace { 18 19 class DefaultVolumnControlDelegate : public VolumeControlDelegate { 20 public: DefaultVolumnControlDelegate()21 DefaultVolumnControlDelegate() {} ~DefaultVolumnControlDelegate()22 virtual ~DefaultVolumnControlDelegate() {} 23 HandleVolumeMute(const ui::Accelerator & accelerator)24 virtual bool HandleVolumeMute(const ui::Accelerator& accelerator) OVERRIDE { 25 return true; 26 } HandleVolumeDown(const ui::Accelerator & accelerator)27 virtual bool HandleVolumeDown(const ui::Accelerator& accelerator) OVERRIDE { 28 return true; 29 } HandleVolumeUp(const ui::Accelerator & accelerator)30 virtual bool HandleVolumeUp(const ui::Accelerator& accelerator) OVERRIDE { 31 return true; 32 } 33 34 private: 35 DISALLOW_COPY_AND_ASSIGN(DefaultVolumnControlDelegate); 36 }; 37 38 } // namespace 39 DefaultSystemTrayDelegate()40DefaultSystemTrayDelegate::DefaultSystemTrayDelegate() 41 : bluetooth_enabled_(true), 42 volume_control_delegate_(new DefaultVolumnControlDelegate) { 43 } 44 ~DefaultSystemTrayDelegate()45DefaultSystemTrayDelegate::~DefaultSystemTrayDelegate() { 46 } 47 Initialize()48void DefaultSystemTrayDelegate::Initialize() { 49 } 50 Shutdown()51void DefaultSystemTrayDelegate::Shutdown() { 52 } 53 GetTrayVisibilityOnStartup()54bool DefaultSystemTrayDelegate::GetTrayVisibilityOnStartup() { 55 return true; 56 } 57 GetUserLoginStatus() const58user::LoginStatus DefaultSystemTrayDelegate::GetUserLoginStatus() const { 59 return user::LOGGED_IN_USER; 60 } 61 IsOobeCompleted() const62bool DefaultSystemTrayDelegate::IsOobeCompleted() const { 63 return true; 64 } 65 ChangeProfilePicture()66void DefaultSystemTrayDelegate::ChangeProfilePicture() { 67 } 68 GetEnterpriseDomain() const69const std::string DefaultSystemTrayDelegate::GetEnterpriseDomain() const { 70 return std::string(); 71 } 72 GetEnterpriseMessage() const73const base::string16 DefaultSystemTrayDelegate::GetEnterpriseMessage() const { 74 return string16(); 75 } 76 77 const std::string GetLocallyManagedUserManager() const78DefaultSystemTrayDelegate::GetLocallyManagedUserManager() const { 79 return std::string(); 80 } 81 82 const base::string16 GetLocallyManagedUserManagerName() const83DefaultSystemTrayDelegate::GetLocallyManagedUserManagerName() 84 const { 85 return string16(); 86 } 87 GetLocallyManagedUserMessage() const88const base::string16 DefaultSystemTrayDelegate::GetLocallyManagedUserMessage() 89 const { 90 return string16(); 91 } 92 SystemShouldUpgrade() const93bool DefaultSystemTrayDelegate::SystemShouldUpgrade() const { 94 return true; 95 } 96 GetHourClockType() const97base::HourClockType DefaultSystemTrayDelegate::GetHourClockType() const { 98 return base::k24HourClock; 99 } 100 ShowSettings()101void DefaultSystemTrayDelegate::ShowSettings() { 102 } 103 ShouldShowSettings()104bool DefaultSystemTrayDelegate::ShouldShowSettings() { 105 return true; 106 } 107 ShowDateSettings()108void DefaultSystemTrayDelegate::ShowDateSettings() { 109 } 110 ShowNetworkSettings(const std::string & service_path)111void DefaultSystemTrayDelegate::ShowNetworkSettings( 112 const std::string& service_path) { 113 } 114 ShowBluetoothSettings()115void DefaultSystemTrayDelegate::ShowBluetoothSettings() { 116 } 117 ShowDisplaySettings()118void DefaultSystemTrayDelegate::ShowDisplaySettings() { 119 } 120 ShowChromeSlow()121void DefaultSystemTrayDelegate::ShowChromeSlow() { 122 } 123 ShouldShowDisplayNotification()124bool DefaultSystemTrayDelegate::ShouldShowDisplayNotification() { 125 return false; 126 } 127 ShowDriveSettings()128void DefaultSystemTrayDelegate::ShowDriveSettings() { 129 } 130 ShowIMESettings()131void DefaultSystemTrayDelegate::ShowIMESettings() { 132 } 133 ShowHelp()134void DefaultSystemTrayDelegate::ShowHelp() { 135 } 136 ShowAccessibilityHelp()137void DefaultSystemTrayDelegate::ShowAccessibilityHelp() { 138 } 139 ShowAccessibilitySettings()140void DefaultSystemTrayDelegate::ShowAccessibilitySettings() { 141 } 142 ShowPublicAccountInfo()143void DefaultSystemTrayDelegate::ShowPublicAccountInfo() { 144 } 145 ShowEnterpriseInfo()146void DefaultSystemTrayDelegate::ShowEnterpriseInfo() { 147 } 148 ShowLocallyManagedUserInfo()149void DefaultSystemTrayDelegate::ShowLocallyManagedUserInfo() { 150 } 151 ShowUserLogin()152void DefaultSystemTrayDelegate::ShowUserLogin() { 153 } 154 ShowSpringChargerReplacementDialog()155void DefaultSystemTrayDelegate::ShowSpringChargerReplacementDialog() { 156 } 157 HasUserConfirmedSafeSpringCharger()158bool DefaultSystemTrayDelegate::HasUserConfirmedSafeSpringCharger() { 159 return false; 160 } 161 ShutDown()162void DefaultSystemTrayDelegate::ShutDown() { 163 } 164 SignOut()165void DefaultSystemTrayDelegate::SignOut() { 166 } 167 RequestLockScreen()168void DefaultSystemTrayDelegate::RequestLockScreen() { 169 } 170 RequestRestartForUpdate()171void DefaultSystemTrayDelegate::RequestRestartForUpdate() { 172 } 173 GetAvailableBluetoothDevices(BluetoothDeviceList * list)174void DefaultSystemTrayDelegate::GetAvailableBluetoothDevices( 175 BluetoothDeviceList* list) { 176 } 177 BluetoothStartDiscovering()178void DefaultSystemTrayDelegate::BluetoothStartDiscovering() { 179 } 180 BluetoothStopDiscovering()181void DefaultSystemTrayDelegate::BluetoothStopDiscovering() { 182 } 183 ConnectToBluetoothDevice(const std::string & address)184void DefaultSystemTrayDelegate::ConnectToBluetoothDevice( 185 const std::string& address) { 186 } 187 GetCurrentIME(IMEInfo * info)188void DefaultSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { 189 } 190 GetAvailableIMEList(IMEInfoList * list)191void DefaultSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) { 192 } 193 GetCurrentIMEProperties(IMEPropertyInfoList * list)194void DefaultSystemTrayDelegate::GetCurrentIMEProperties( 195 IMEPropertyInfoList* list) { 196 } 197 SwitchIME(const std::string & ime_id)198void DefaultSystemTrayDelegate::SwitchIME(const std::string& ime_id) { 199 } 200 ActivateIMEProperty(const std::string & key)201void DefaultSystemTrayDelegate::ActivateIMEProperty(const std::string& key) { 202 } 203 CancelDriveOperation(int32 operation_id)204void DefaultSystemTrayDelegate::CancelDriveOperation(int32 operation_id) { 205 } 206 GetDriveOperationStatusList(ash::DriveOperationStatusList *)207void DefaultSystemTrayDelegate::GetDriveOperationStatusList( 208 ash::DriveOperationStatusList*) { 209 } 210 ShowNetworkConfigure(const std::string & network_id,gfx::NativeWindow parent_window)211void DefaultSystemTrayDelegate::ShowNetworkConfigure( 212 const std::string& network_id, 213 gfx::NativeWindow parent_window) { 214 } 215 EnrollNetwork(const std::string & network_id,gfx::NativeWindow parent_window)216bool DefaultSystemTrayDelegate::EnrollNetwork(const std::string& network_id, 217 gfx::NativeWindow parent_window) { 218 return true; 219 } 220 ManageBluetoothDevices()221void DefaultSystemTrayDelegate::ManageBluetoothDevices() { 222 } 223 ToggleBluetooth()224void DefaultSystemTrayDelegate::ToggleBluetooth() { 225 bluetooth_enabled_ = !bluetooth_enabled_; 226 } 227 IsBluetoothDiscovering()228bool DefaultSystemTrayDelegate::IsBluetoothDiscovering() { 229 return false; 230 } 231 ShowMobileSimDialog()232void DefaultSystemTrayDelegate::ShowMobileSimDialog() { 233 } 234 ShowMobileSetupDialog(const std::string & service_path)235void DefaultSystemTrayDelegate::ShowMobileSetupDialog( 236 const std::string& service_path) { 237 } 238 ShowOtherNetworkDialog(const std::string & type)239void DefaultSystemTrayDelegate::ShowOtherNetworkDialog( 240 const std::string& type) { 241 } 242 GetBluetoothAvailable()243bool DefaultSystemTrayDelegate::GetBluetoothAvailable() { 244 return true; 245 } 246 GetBluetoothEnabled()247bool DefaultSystemTrayDelegate::GetBluetoothEnabled() { 248 return bluetooth_enabled_; 249 } 250 ChangeProxySettings()251void DefaultSystemTrayDelegate::ChangeProxySettings() { 252 } 253 GetVolumeControlDelegate() const254VolumeControlDelegate* DefaultSystemTrayDelegate::GetVolumeControlDelegate() 255 const { 256 return volume_control_delegate_.get(); 257 } 258 SetVolumeControlDelegate(scoped_ptr<VolumeControlDelegate> delegate)259void DefaultSystemTrayDelegate::SetVolumeControlDelegate( 260 scoped_ptr<VolumeControlDelegate> delegate) { 261 volume_control_delegate_ = delegate.Pass(); 262 } 263 GetSessionStartTime(base::TimeTicks * session_start_time)264bool DefaultSystemTrayDelegate::GetSessionStartTime( 265 base::TimeTicks* session_start_time) { 266 return false; 267 } 268 GetSessionLengthLimit(base::TimeDelta * session_length_limit)269bool DefaultSystemTrayDelegate::GetSessionLengthLimit( 270 base::TimeDelta* session_length_limit) { 271 return false; 272 } 273 GetSystemTrayMenuWidth()274int DefaultSystemTrayDelegate::GetSystemTrayMenuWidth() { 275 // This is the default width for English languages. 276 return 300; 277 } 278 279 } // namespace ash 280