Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: ash/common/system/date/tray_date.h

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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_COMMON_SYSTEM_DATE_TRAY_DATE_H_
6 #define ASH_COMMON_SYSTEM_DATE_TRAY_DATE_H_
7
8 #include <memory>
9
10 #include "ash/ash_export.h"
11 #include "ash/common/login_status.h"
12 #include "ash/common/system/date/clock_observer.h"
13 #include "ash/common/system/tray/system_tray_item.h"
14 #include "base/macros.h"
15
16 namespace ash {
17 class DateDefaultView;
18 class SystemClockObserver;
19
20 namespace tray {
21 class TimeView;
22 }
23
24 // System tray item for the time and date.
25 class ASH_EXPORT TrayDate : public SystemTrayItem, public ClockObserver {
26 public:
27 enum ClockLayout {
28 HORIZONTAL_CLOCK,
29 VERTICAL_CLOCK,
30 };
31
32 enum DateAction {
33 NONE,
34 SET_SYSTEM_TIME,
35 SHOW_DATE_SETTINGS,
36 };
37
38 explicit TrayDate(SystemTray* system_tray);
39 ~TrayDate() override;
40
41 // Returns view for help button if it is exists. Returns NULL otherwise.
42 views::View* GetHelpButtonView() const;
43
44 const tray::TimeView* GetTimeTrayForTesting() const;
45 const DateDefaultView* GetDefaultViewForTesting() const;
46 views::View* CreateDefaultViewForTesting(LoginStatus status);
47
48 private:
49 // Overridden from SystemTrayItem.
50 views::View* CreateTrayView(LoginStatus status) override;
51 views::View* CreateDefaultView(LoginStatus status) override;
52 views::View* CreateDetailedView(LoginStatus status) override;
53 void DestroyTrayView() override;
54 void DestroyDefaultView() override;
55 void DestroyDetailedView() override;
56 void UpdateAfterLoginStatusChange(LoginStatus status) override;
57 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override;
58
59 // Overridden from ClockObserver.
60 void OnDateFormatChanged() override;
61 void OnSystemClockTimeUpdated() override;
62 void OnSystemClockCanSetTimeChanged(bool can_set_time) override;
63 void Refresh() override;
64
65 tray::TimeView* time_tray_;
66 DateDefaultView* default_view_;
67 LoginStatus login_status_;
68
69 std::unique_ptr<SystemClockObserver> system_clock_observer_;
70
71 DISALLOW_COPY_AND_ASSIGN(TrayDate);
72 };
73
74 } // namespace ash
75
76 #endif // ASH_COMMON_SYSTEM_DATE_TRAY_DATE_H_
OLDNEW
« no previous file with comments | « ash/common/system/date/system_info_default_view_unittest.cc ('k') | ash/common/system/date/tray_date.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698