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 GetLocallyManagedUserManager() const74DefaultSystemTrayDelegate::GetLocallyManagedUserManager() const { 75 return std::string(); 76 } 77 78 const base::string16 GetLocallyManagedUserManagerName() const79DefaultSystemTrayDelegate::GetLocallyManagedUserManagerName() 80 const { 81 return base::string16(); 82 } 83 GetLocallyManagedUserMessage() const84const base::string16 DefaultSystemTrayDelegate::GetLocallyManagedUserMessage() 85 const { 86 return base::string16(); 87 } 88 SystemShouldUpgrade() const89bool DefaultSystemTrayDelegate::SystemShouldUpgrade() const { 90 return true; 91 } 92 GetHourClockType() const93base::HourClockType DefaultSystemTrayDelegate::GetHourClockType() const { 94 return base::k24HourClock; 95 } 96 ShowSettings()97void DefaultSystemTrayDelegate::ShowSettings() { 98 } 99 ShouldShowSettings()100bool DefaultSystemTrayDelegate::ShouldShowSettings() { 101 return true; 102 } 103 ShowDateSettings()104void DefaultSystemTrayDelegate::ShowDateSettings() { 105 } 106 ShowSetTimeDialog()107void DefaultSystemTrayDelegate::ShowSetTimeDialog() { 108 } 109 ShowNetworkSettings(const std::string & service_path)110void DefaultSystemTrayDelegate::ShowNetworkSettings( 111 const std::string& service_path) { 112 } 113 ShowBluetoothSettings()114void DefaultSystemTrayDelegate::ShowBluetoothSettings() { 115 } 116 ShowDisplaySettings()117void DefaultSystemTrayDelegate::ShowDisplaySettings() { 118 } 119 ShowChromeSlow()120void DefaultSystemTrayDelegate::ShowChromeSlow() { 121 } 122 ShouldShowDisplayNotification()123bool DefaultSystemTrayDelegate::ShouldShowDisplayNotification() { 124 return false; 125 } 126 ShowDriveSettings()127void DefaultSystemTrayDelegate::ShowDriveSettings() { 128 } 129 ShowIMESettings()130void DefaultSystemTrayDelegate::ShowIMESettings() { 131 } 132 ShowHelp()133void DefaultSystemTrayDelegate::ShowHelp() { 134 } 135 ShowAccessibilityHelp()136void DefaultSystemTrayDelegate::ShowAccessibilityHelp() { 137 } 138 ShowAccessibilitySettings()139void DefaultSystemTrayDelegate::ShowAccessibilitySettings() { 140 } 141 ShowPublicAccountInfo()142void DefaultSystemTrayDelegate::ShowPublicAccountInfo() { 143 } 144 ShowEnterpriseInfo()145void DefaultSystemTrayDelegate::ShowEnterpriseInfo() { 146 } 147 ShowLocallyManagedUserInfo()148void DefaultSystemTrayDelegate::ShowLocallyManagedUserInfo() { 149 } 150 ShowUserLogin()151void DefaultSystemTrayDelegate::ShowUserLogin() { 152 } 153 ShowSpringChargerReplacementDialog()154bool DefaultSystemTrayDelegate::ShowSpringChargerReplacementDialog() { 155 return false; 156 } 157 IsSpringChargerReplacementDialogVisible()158bool DefaultSystemTrayDelegate::IsSpringChargerReplacementDialogVisible() { 159 return false; 160 } 161 HasUserConfirmedSafeSpringCharger()162bool DefaultSystemTrayDelegate::HasUserConfirmedSafeSpringCharger() { 163 return false; 164 } 165 ShutDown()166void DefaultSystemTrayDelegate::ShutDown() { 167 } 168 SignOut()169void DefaultSystemTrayDelegate::SignOut() { 170 } 171 RequestLockScreen()172void DefaultSystemTrayDelegate::RequestLockScreen() { 173 } 174 RequestRestartForUpdate()175void DefaultSystemTrayDelegate::RequestRestartForUpdate() { 176 } 177 GetAvailableBluetoothDevices(BluetoothDeviceList * list)178void DefaultSystemTrayDelegate::GetAvailableBluetoothDevices( 179 BluetoothDeviceList* list) { 180 } 181 BluetoothStartDiscovering()182void DefaultSystemTrayDelegate::BluetoothStartDiscovering() { 183 } 184 BluetoothStopDiscovering()185void DefaultSystemTrayDelegate::BluetoothStopDiscovering() { 186 } 187 ConnectToBluetoothDevice(const std::string & address)188void DefaultSystemTrayDelegate::ConnectToBluetoothDevice( 189 const std::string& address) { 190 } 191 GetCurrentIME(IMEInfo * info)192void DefaultSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { 193 } 194 GetAvailableIMEList(IMEInfoList * list)195void DefaultSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) { 196 } 197 GetCurrentIMEProperties(IMEPropertyInfoList * list)198void DefaultSystemTrayDelegate::GetCurrentIMEProperties( 199 IMEPropertyInfoList* list) { 200 } 201 SwitchIME(const std::string & ime_id)202void DefaultSystemTrayDelegate::SwitchIME(const std::string& ime_id) { 203 } 204 ActivateIMEProperty(const std::string & key)205void DefaultSystemTrayDelegate::ActivateIMEProperty(const std::string& key) { 206 } 207 CancelDriveOperation(int32 operation_id)208void DefaultSystemTrayDelegate::CancelDriveOperation(int32 operation_id) { 209 } 210 GetDriveOperationStatusList(ash::DriveOperationStatusList *)211void DefaultSystemTrayDelegate::GetDriveOperationStatusList( 212 ash::DriveOperationStatusList*) { 213 } 214 ShowNetworkConfigure(const std::string & network_id,gfx::NativeWindow parent_window)215void DefaultSystemTrayDelegate::ShowNetworkConfigure( 216 const std::string& network_id, 217 gfx::NativeWindow parent_window) { 218 } 219 EnrollNetwork(const std::string & network_id,gfx::NativeWindow parent_window)220bool DefaultSystemTrayDelegate::EnrollNetwork(const std::string& network_id, 221 gfx::NativeWindow parent_window) { 222 return true; 223 } 224 ManageBluetoothDevices()225void DefaultSystemTrayDelegate::ManageBluetoothDevices() { 226 } 227 ToggleBluetooth()228void DefaultSystemTrayDelegate::ToggleBluetooth() { 229 bluetooth_enabled_ = !bluetooth_enabled_; 230 } 231 IsBluetoothDiscovering()232bool DefaultSystemTrayDelegate::IsBluetoothDiscovering() { 233 return false; 234 } 235 ShowMobileSimDialog()236void DefaultSystemTrayDelegate::ShowMobileSimDialog() { 237 } 238 ShowMobileSetupDialog(const std::string & service_path)239void DefaultSystemTrayDelegate::ShowMobileSetupDialog( 240 const std::string& service_path) { 241 } 242 ShowOtherNetworkDialog(const std::string & type)243void DefaultSystemTrayDelegate::ShowOtherNetworkDialog( 244 const std::string& type) { 245 } 246 GetBluetoothAvailable()247bool DefaultSystemTrayDelegate::GetBluetoothAvailable() { 248 return true; 249 } 250 GetBluetoothEnabled()251bool DefaultSystemTrayDelegate::GetBluetoothEnabled() { 252 return bluetooth_enabled_; 253 } 254 GetBluetoothDiscovering()255bool DefaultSystemTrayDelegate::GetBluetoothDiscovering() { 256 return false; 257 } 258 ChangeProxySettings()259void DefaultSystemTrayDelegate::ChangeProxySettings() { 260 } 261 GetVolumeControlDelegate() const262VolumeControlDelegate* DefaultSystemTrayDelegate::GetVolumeControlDelegate() 263 const { 264 return volume_control_delegate_.get(); 265 } 266 SetVolumeControlDelegate(scoped_ptr<VolumeControlDelegate> delegate)267void DefaultSystemTrayDelegate::SetVolumeControlDelegate( 268 scoped_ptr<VolumeControlDelegate> delegate) { 269 volume_control_delegate_ = delegate.Pass(); 270 } 271 GetSessionStartTime(base::TimeTicks * session_start_time)272bool DefaultSystemTrayDelegate::GetSessionStartTime( 273 base::TimeTicks* session_start_time) { 274 return false; 275 } 276 GetSessionLengthLimit(base::TimeDelta * session_length_limit)277bool DefaultSystemTrayDelegate::GetSessionLengthLimit( 278 base::TimeDelta* session_length_limit) { 279 return false; 280 } 281 GetSystemTrayMenuWidth()282int DefaultSystemTrayDelegate::GetSystemTrayMenuWidth() { 283 // This is the default width for English languages. 284 return 300; 285 } 286 ActiveUserWasChanged()287void DefaultSystemTrayDelegate::ActiveUserWasChanged() { 288 } 289 IsNetworkBehindCaptivePortal(const std::string &) const290bool DefaultSystemTrayDelegate::IsNetworkBehindCaptivePortal( 291 const std::string& /* service_path */) const { 292 return false; 293 } 294 IsSearchKeyMappedToCapsLock()295bool DefaultSystemTrayDelegate::IsSearchKeyMappedToCapsLock() { 296 return false; 297 } 298 GetUserAccountsDelegate(const std::string & user_id)299tray::UserAccountsDelegate* DefaultSystemTrayDelegate::GetUserAccountsDelegate( 300 const std::string& user_id) { 301 return NULL; 302 } 303 304 } // namespace ash 305