Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / ash / system / date / tray_date.h
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/ash_export.h"
9 #include "ash/system/date/clock_observer.h"
10 #include "ash/system/tray/system_tray_item.h"
11 #include "base/memory/scoped_ptr.h"
12
13 namespace views {
14 class Label;
15 }
16
17 namespace ash {
18 namespace internal {
19
20 #if defined(OS_CHROMEOS)
21 class SystemClockObserver;
22 #endif
23 class DateDefaultView;
24
25 namespace tray {
26 class TimeView;
27 }
28
29 class ASH_EXPORT TrayDate : public SystemTrayItem, public ClockObserver {
30  public:
31   enum ClockLayout {
32    HORIZONTAL_CLOCK,
33    VERTICAL_CLOCK,
34   };
35   explicit TrayDate(SystemTray* system_tray);
36   virtual ~TrayDate();
37
38   // Returns view for help button if it is exists. Returns NULL otherwise.
39   views::View* GetHelpButtonView() const;
40
41   const tray::TimeView* GetTimeTrayForTesting() const;
42   const DateDefaultView* GetDefaultViewForTesting() const;
43   views::View* CreateDefaultViewForTesting(user::LoginStatus status);
44
45  private:
46   // Overridden from SystemTrayItem.
47   virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
48   virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
49   virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
50   virtual void DestroyTrayView() OVERRIDE;
51   virtual void DestroyDefaultView() OVERRIDE;
52   virtual void DestroyDetailedView() OVERRIDE;
53   virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE;
54   virtual void UpdateAfterShelfAlignmentChange(
55       ShelfAlignment alignment) OVERRIDE;
56
57   // Overridden from ClockObserver.
58   virtual void OnDateFormatChanged() OVERRIDE;
59   virtual void OnSystemClockTimeUpdated() OVERRIDE;
60   virtual void Refresh() OVERRIDE;
61
62   void SetupLabelForTimeTray(views::Label* label);
63
64   tray::TimeView* time_tray_;
65   DateDefaultView* default_view_;
66
67 #if defined(OS_CHROMEOS)
68   scoped_ptr<SystemClockObserver> system_clock_observer_;
69 #endif
70
71   DISALLOW_COPY_AND_ASSIGN(TrayDate);
72 };
73
74 }  // namespace internal
75 }  // namespace ash
76
77 #endif  // ASH_SYSTEM_DATE_TRAY_DATE_H_