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