Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ash / system / date / tray_date.h
blobc84e86ebad47baede33486c262a004567400d152
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/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"
13 namespace views {
14 class Label;
17 namespace ash {
18 class DateDefaultView;
19 #if defined(OS_CHROMEOS)
20 class SystemClockObserver;
21 #endif
23 namespace tray {
24 class TimeView;
27 class ASH_EXPORT TrayDate : public SystemTrayItem, public ClockObserver {
28 public:
29 enum ClockLayout {
30 HORIZONTAL_CLOCK,
31 VERTICAL_CLOCK,
34 enum DateAction {
35 NONE,
36 SET_SYSTEM_TIME,
37 SHOW_DATE_SETTINGS,
40 explicit TrayDate(SystemTray* system_tray);
41 virtual ~TrayDate();
43 // Returns view for help button if it is exists. Returns NULL otherwise.
44 views::View* GetHelpButtonView() const;
46 const tray::TimeView* GetTimeTrayForTesting() const;
47 const DateDefaultView* GetDefaultViewForTesting() const;
48 views::View* CreateDefaultViewForTesting(user::LoginStatus status);
50 private:
51 // Overridden from SystemTrayItem.
52 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
53 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
54 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
55 virtual void DestroyTrayView() OVERRIDE;
56 virtual void DestroyDefaultView() OVERRIDE;
57 virtual void DestroyDetailedView() OVERRIDE;
58 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE;
59 virtual void UpdateAfterShelfAlignmentChange(
60 ShelfAlignment alignment) OVERRIDE;
62 // Overridden from ClockObserver.
63 virtual void OnDateFormatChanged() OVERRIDE;
64 virtual void OnSystemClockTimeUpdated() OVERRIDE;
65 virtual void OnSystemClockCanSetTimeChanged(bool can_set_time) OVERRIDE;
66 virtual void Refresh() OVERRIDE;
68 void SetupLabelForTimeTray(views::Label* label);
70 tray::TimeView* time_tray_;
71 DateDefaultView* default_view_;
72 user::LoginStatus login_status_;
74 #if defined(OS_CHROMEOS)
75 scoped_ptr<SystemClockObserver> system_clock_observer_;
76 #endif
78 DISALLOW_COPY_AND_ASSIGN(TrayDate);
81 } // namespace ash
83 #endif // ASH_SYSTEM_DATE_TRAY_DATE_H_