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.
5 #ifndef ASH_SYSTEM_CHROMEOS_LOCALLY_MANAGED_TRAY_LOCALLY_MANAGED_USER_H
6 #define ASH_SYSTEM_CHROMEOS_LOCALLY_MANAGED_TRAY_LOCALLY_MANAGED_USER_H
8 #include "ash/ash_export.h"
9 #include "ash/system/tray/system_tray_item.h"
10 #include "ash/system/tray/view_click_listener.h"
11 #include "base/strings/string16.h"
20 class ASH_EXPORT TrayLocallyManagedUser : public SystemTrayItem,
21 public ViewClickListener {
23 explicit TrayLocallyManagedUser(SystemTray* system_tray);
24 virtual ~TrayLocallyManagedUser();
26 // If message is not empty updates content of default view, otherwise hides
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;
35 // Overridden from ViewClickListener.
36 virtual void OnViewClicked(views::View* sender) OVERRIDE;
39 friend class TrayLocallyManagedUserTest;
41 static const char kNotificationId[];
43 void CreateOrUpdateNotification(const base::string16& new_message);
45 LabelTrayView* tray_view_;
46 // Previous login status to avoid showing notification upon unlock.
47 user::LoginStatus status_;
49 DISALLOW_COPY_AND_ASSIGN(TrayLocallyManagedUser);
52 } // namespace internal
55 #endif // ASH_SYSTEM_CHROMEOS_LOCALLY_MANAGED_TRAY_LOCALLY_MANAGED_USER_H