1 // Copyright (c) 2012 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 #ifndef ASH_SYSTEM_CHROMEOS_LOCALLY_MANAGED_TRAY_LOCALLY_MANAGED_USER_H 6 #define ASH_SYSTEM_CHROMEOS_LOCALLY_MANAGED_TRAY_LOCALLY_MANAGED_USER_H 7 8 #include "ash/system/tray/system_tray_item.h" 9 #include "ash/system/tray/view_click_listener.h" 10 11 namespace ash { 12 class SystemTray; 13 } 14 15 namespace ash { 16 namespace internal { 17 18 class LabelTrayView; 19 20 class TrayLocallyManagedUser : public SystemTrayItem, 21 public ViewClickListener { 22 public: 23 explicit TrayLocallyManagedUser(SystemTray* system_tray); 24 virtual ~TrayLocallyManagedUser(); 25 26 // If message is not empty updates content of default view, otherwise hides 27 // tray items. 28 void UpdateMessage(); 29 30 // Overridden from SystemTrayItem. 31 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; 32 virtual void DestroyDefaultView() OVERRIDE; 33 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; 34 35 // Overridden from ViewClickListener. 36 virtual void OnViewClicked(views::View* sender) OVERRIDE; 37 38 private: 39 LabelTrayView* tray_view_; 40 // Previous login status to avoid showing notification upon unlock. 41 user::LoginStatus status_; 42 43 DISALLOW_COPY_AND_ASSIGN(TrayLocallyManagedUser); 44 }; 45 46 } // namespace internal 47 } // namespace ash 48 49 #endif // ASH_SYSTEM_CHROMEOS_LOCALLY_MANAGED_TRAY_LOCALLY_MANAGED_USER_H 50