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_DATE_TRAY_DATE_H_
6 #define ASH_SYSTEM_DATE_TRAY_DATE_H_
8 #include "ash/system/date/clock_observer.h"
9 #include "ash/system/tray/system_tray_item.h"
10 #include "base/memory/scoped_ptr.h"
19 #if defined(OS_CHROMEOS)
20 class SystemClockObserver;
27 class TrayDate : public SystemTrayItem,
28 public ClockObserver {
34 explicit TrayDate(SystemTray* system_tray);
37 // Returns view for help button if it is exists. Returns NULL otherwise.
38 views::View* GetHelpButtonView() const;
41 // Overridden from SystemTrayItem.
42 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
43 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
44 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
45 virtual void DestroyTrayView() OVERRIDE;
46 virtual void DestroyDefaultView() OVERRIDE;
47 virtual void DestroyDetailedView() OVERRIDE;
48 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE;
49 virtual void UpdateAfterShelfAlignmentChange(
50 ShelfAlignment alignment) OVERRIDE;
52 // Overridden from ClockObserver.
53 virtual void OnDateFormatChanged() OVERRIDE;
54 virtual void OnSystemClockTimeUpdated() OVERRIDE;
55 virtual void Refresh() OVERRIDE;
57 void SetupLabelForTimeTray(views::Label* label);
59 tray::TimeView* time_tray_;
60 views::View* default_view_;
62 #if defined(OS_CHROMEOS)
63 scoped_ptr<SystemClockObserver> system_clock_observer_;
66 DISALLOW_COPY_AND_ASSIGN(TrayDate);
69 } // namespace internal
72 #endif // ASH_SYSTEM_DATE_TRAY_DATE_H_