Home | History | Annotate | Download | only in date
      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_DATE_TRAY_DATE_H_
      6 #define ASH_SYSTEM_DATE_TRAY_DATE_H_
      7 
      8 #include "ash/system/date/clock_observer.h"
      9 #include "ash/system/tray/system_tray_item.h"
     10 
     11 namespace views {
     12 class Label;
     13 }
     14 
     15 namespace ash {
     16 namespace internal {
     17 
     18 namespace tray {
     19 class TimeView;
     20 }
     21 
     22 class TrayDate : public SystemTrayItem,
     23                  public ClockObserver {
     24  public:
     25   enum ClockLayout {
     26    HORIZONTAL_CLOCK,
     27    VERTICAL_CLOCK,
     28   };
     29   explicit TrayDate(SystemTray* system_tray);
     30   virtual ~TrayDate();
     31 
     32  private:
     33   // Overridden from SystemTrayItem.
     34   virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
     35   virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
     36   virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
     37   virtual void DestroyTrayView() OVERRIDE;
     38   virtual void DestroyDefaultView() OVERRIDE;
     39   virtual void DestroyDetailedView() OVERRIDE;
     40   virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE;
     41   virtual void UpdateAfterShelfAlignmentChange(
     42       ShelfAlignment alignment) OVERRIDE;
     43 
     44   // Overridden from ClockObserver.
     45   virtual void OnDateFormatChanged() OVERRIDE;
     46   virtual void OnSystemClockTimeUpdated() OVERRIDE;
     47   virtual void Refresh() OVERRIDE;
     48 
     49   void SetupLabelForTimeTray(views::Label* label);
     50 
     51   tray::TimeView* time_tray_;
     52 
     53   DISALLOW_COPY_AND_ASSIGN(TrayDate);
     54 };
     55 
     56 }  // namespace internal
     57 }  // namespace ash
     58 
     59 #endif  // ASH_SYSTEM_DATE_TRAY_DATE_H_
     60