| OLD | NEW |
| (Empty) |
| 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 #include <utility> | |
| 9 | |
| 10 #include "ash/networking_config_delegate.h" | |
| 11 #include "ash/shell.h" | |
| 12 #include "ash/volume_control_delegate.h" | |
| 13 #include "base/message_loop/message_loop.h" | |
| 14 #include "base/time/time.h" | |
| 15 | |
| 16 namespace ash { | |
| 17 | |
| 18 DefaultSystemTrayDelegate::DefaultSystemTrayDelegate() | |
| 19 : bluetooth_enabled_(true) { | |
| 20 } | |
| 21 | |
| 22 DefaultSystemTrayDelegate::~DefaultSystemTrayDelegate() { | |
| 23 } | |
| 24 | |
| 25 bool DefaultSystemTrayDelegate::GetTrayVisibilityOnStartup() { | |
| 26 return true; | |
| 27 } | |
| 28 | |
| 29 LoginStatus DefaultSystemTrayDelegate::GetUserLoginStatus() const { | |
| 30 return LoginStatus::USER; | |
| 31 } | |
| 32 | |
| 33 std::string DefaultSystemTrayDelegate::GetSupervisedUserManager() const { | |
| 34 if (!IsUserSupervised()) | |
| 35 return std::string(); | |
| 36 return "manager@chrome.com"; | |
| 37 } | |
| 38 | |
| 39 bool DefaultSystemTrayDelegate::IsUserSupervised() const { | |
| 40 return GetUserLoginStatus() == LoginStatus::SUPERVISED; | |
| 41 } | |
| 42 | |
| 43 void DefaultSystemTrayDelegate::GetSystemUpdateInfo(UpdateInfo* info) const { | |
| 44 DCHECK(info); | |
| 45 info->severity = UpdateInfo::UPDATE_NORMAL; | |
| 46 info->update_required = true; | |
| 47 info->factory_reset_required = false; | |
| 48 } | |
| 49 | |
| 50 bool DefaultSystemTrayDelegate::ShouldShowSettings() { | |
| 51 return true; | |
| 52 } | |
| 53 | |
| 54 bool DefaultSystemTrayDelegate::ShouldShowDisplayNotification() { | |
| 55 return false; | |
| 56 } | |
| 57 | |
| 58 void DefaultSystemTrayDelegate::ToggleBluetooth() { | |
| 59 bluetooth_enabled_ = !bluetooth_enabled_; | |
| 60 } | |
| 61 | |
| 62 bool DefaultSystemTrayDelegate::IsBluetoothDiscovering() { | |
| 63 return false; | |
| 64 } | |
| 65 | |
| 66 bool DefaultSystemTrayDelegate::GetBluetoothAvailable() { | |
| 67 return true; | |
| 68 } | |
| 69 | |
| 70 bool DefaultSystemTrayDelegate::GetBluetoothEnabled() { | |
| 71 return bluetooth_enabled_; | |
| 72 } | |
| 73 | |
| 74 bool DefaultSystemTrayDelegate::GetBluetoothDiscovering() { | |
| 75 return false; | |
| 76 } | |
| 77 | |
| 78 VolumeControlDelegate* DefaultSystemTrayDelegate::GetVolumeControlDelegate() | |
| 79 const { | |
| 80 return volume_control_delegate_.get(); | |
| 81 } | |
| 82 | |
| 83 void DefaultSystemTrayDelegate::SetVolumeControlDelegate( | |
| 84 std::unique_ptr<VolumeControlDelegate> delegate) { | |
| 85 volume_control_delegate_ = std::move(delegate); | |
| 86 } | |
| 87 | |
| 88 int DefaultSystemTrayDelegate::GetSystemTrayMenuWidth() { | |
| 89 // This is the default width for English languages. | |
| 90 return 300; | |
| 91 } | |
| 92 | |
| 93 } // namespace ash | |
| OLD | NEW |