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/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 ChangeProfilePicture()62void DefaultSystemTrayDelegate::ChangeProfilePicture() { 63 } 64 GetEnterpriseDomain() const65const std::string DefaultSystemTrayDelegate::GetEnterpriseDomain() const { 66 return std::string(); 67 } 68 GetEnterpriseMessage() const69const base::string16 DefaultSystemTrayDelegate::GetEnterpriseMessage() const { 70 return base::string16(); 71 } 72 73 const std::string GetSupervisedUserManager() const74DefaultSystemTrayDelegate::GetSupervisedUserManager() const { 75 return std::string(); 76 } 77 78 const base::string16 GetSupervisedUserManagerName() const79DefaultSystemTrayDelegate::GetSupervisedUserManagerName() 80 const { 81 return base::string16(); 82 } 83 GetSupervisedUserMessage() const84const base::string16 DefaultSystemTrayDelegate::GetSupervisedUserMessage() 85 const { 86 return base::string16(); 87 } 88 IsUserSupervised() const89bool DefaultSystemTrayDelegate::IsUserSupervised() const { 90 return false; 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 ShowSetTimeDialog()111void DefaultSystemTrayDelegate::ShowSetTimeDialog() { 112 } 113 ShowNetworkSettings(const std::string & service_path)114void DefaultSystemTrayDelegate::ShowNetworkSettings( 115 const std::string& service_path) { 116 } 117 ShowBluetoothSettings()118void DefaultSystemTrayDelegate::ShowBluetoothSettings() { 119 } 120 ShowDisplaySettings()121void DefaultSystemTrayDelegate::ShowDisplaySettings() { 122 } 123 ShowChromeSlow()124void DefaultSystemTrayDelegate::ShowChromeSlow() { 125 } 126 ShouldShowDisplayNotification()127bool DefaultSystemTrayDelegate::ShouldShowDisplayNotification() { 128 return false; 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 ShowSupervisedUserInfo()149void DefaultSystemTrayDelegate::ShowSupervisedUserInfo() { 150 } 151 ShowUserLogin()152void DefaultSystemTrayDelegate::ShowUserLogin() { 153 } 154 ShowSpringChargerReplacementDialog()155bool DefaultSystemTrayDelegate::ShowSpringChargerReplacementDialog() { 156 return false; 157 } 158 IsSpringChargerReplacementDialogVisible()159bool DefaultSystemTrayDelegate::IsSpringChargerReplacementDialogVisible() { 160 return false; 161 } 162 HasUserConfirmedSafeSpringCharger()163bool DefaultSystemTrayDelegate::HasUserConfirmedSafeSpringCharger() { 164 return false; 165 } 166 ShutDown()167void DefaultSystemTrayDelegate::ShutDown() { 168 } 169 SignOut()170void DefaultSystemTrayDelegate::SignOut() { 171 } 172 RequestLockScreen()173void DefaultSystemTrayDelegate::RequestLockScreen() { 174 } 175 RequestRestartForUpdate()176void DefaultSystemTrayDelegate::RequestRestartForUpdate() { 177 } 178 GetAvailableBluetoothDevices(BluetoothDeviceList * list)179void DefaultSystemTrayDelegate::GetAvailableBluetoothDevices( 180 BluetoothDeviceList* list) { 181 } 182 BluetoothStartDiscovering()183void DefaultSystemTrayDelegate::BluetoothStartDiscovering() { 184 } 185 BluetoothStopDiscovering()186void DefaultSystemTrayDelegate::BluetoothStopDiscovering() { 187 } 188 ConnectToBluetoothDevice(const std::string & address)189void DefaultSystemTrayDelegate::ConnectToBluetoothDevice( 190 const std::string& address) { 191 } 192 GetCurrentIME(IMEInfo * info)193void DefaultSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { 194 } 195 GetAvailableIMEList(IMEInfoList * list)196void DefaultSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) { 197 } 198 GetCurrentIMEProperties(IMEPropertyInfoList * list)199void DefaultSystemTrayDelegate::GetCurrentIMEProperties( 200 IMEPropertyInfoList* list) { 201 } 202 SwitchIME(const std::string & ime_id)203void DefaultSystemTrayDelegate::SwitchIME(const std::string& ime_id) { 204 } 205 ActivateIMEProperty(const std::string & key)206void DefaultSystemTrayDelegate::ActivateIMEProperty(const std::string& key) { 207 } 208 ShowNetworkConfigure(const std::string & network_id)209void DefaultSystemTrayDelegate::ShowNetworkConfigure( 210 const std::string& network_id) { 211 } 212 EnrollNetwork(const std::string & network_id)213bool DefaultSystemTrayDelegate::EnrollNetwork(const std::string& network_id) { 214 return true; 215 } 216 ManageBluetoothDevices()217void DefaultSystemTrayDelegate::ManageBluetoothDevices() { 218 } 219 ToggleBluetooth()220void DefaultSystemTrayDelegate::ToggleBluetooth() { 221 bluetooth_enabled_ = !bluetooth_enabled_; 222 } 223 IsBluetoothDiscovering()224bool DefaultSystemTrayDelegate::IsBluetoothDiscovering() { 225 return false; 226 } 227 ShowMobileSimDialog()228void DefaultSystemTrayDelegate::ShowMobileSimDialog() { 229 } 230 ShowMobileSetupDialog(const std::string & service_path)231void DefaultSystemTrayDelegate::ShowMobileSetupDialog( 232 const std::string& service_path) { 233 } 234 ShowOtherNetworkDialog(const std::string & type)235void DefaultSystemTrayDelegate::ShowOtherNetworkDialog( 236 const std::string& type) { 237 } 238 GetBluetoothAvailable()239bool DefaultSystemTrayDelegate::GetBluetoothAvailable() { 240 return true; 241 } 242 GetBluetoothEnabled()243bool DefaultSystemTrayDelegate::GetBluetoothEnabled() { 244 return bluetooth_enabled_; 245 } 246 GetBluetoothDiscovering()247bool DefaultSystemTrayDelegate::GetBluetoothDiscovering() { 248 return false; 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 ActiveUserWasChanged()279void DefaultSystemTrayDelegate::ActiveUserWasChanged() { 280 } 281 IsSearchKeyMappedToCapsLock()282bool DefaultSystemTrayDelegate::IsSearchKeyMappedToCapsLock() { 283 return false; 284 } 285 GetUserAccountsDelegate(const std::string & user_id)286tray::UserAccountsDelegate* DefaultSystemTrayDelegate::GetUserAccountsDelegate( 287 const std::string& user_id) { 288 return NULL; 289 } 290 291 } // namespace ash 292