| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 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_SYSTEM_INFO_H_ | |
| 6 #define ASH_COMMON_SYSTEM_DATE_TRAY_SYSTEM_INFO_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 views { | |
| 17 class Label; | |
| 18 } | |
| 19 | |
| 20 namespace ash { | |
| 21 class SystemClockObserver; | |
| 22 class SystemInfoDefaultView; | |
| 23 | |
| 24 namespace tray { | |
| 25 class TimeView; | |
| 26 } | |
| 27 | |
| 28 // The bottom row of the system menu. The default view shows the current date | |
| 29 // and power status. The tray view shows the current time. | |
| 30 class ASH_EXPORT TraySystemInfo : public SystemTrayItem, public ClockObserver { | |
| 31 public: | |
| 32 explicit TraySystemInfo(SystemTray* system_tray); | |
| 33 ~TraySystemInfo() override; | |
| 34 | |
| 35 const tray::TimeView* GetTimeTrayForTesting() const; | |
| 36 const SystemInfoDefaultView* GetDefaultViewForTesting() const; | |
| 37 views::View* CreateDefaultViewForTesting(LoginStatus status); | |
| 38 | |
| 39 private: | |
| 40 // SystemTrayItem: | |
| 41 views::View* CreateTrayView(LoginStatus status) override; | |
| 42 views::View* CreateDefaultView(LoginStatus status) override; | |
| 43 void DestroyTrayView() override; | |
| 44 void DestroyDefaultView() override; | |
| 45 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override; | |
| 46 | |
| 47 // ClockObserver: | |
| 48 void OnDateFormatChanged() override; | |
| 49 void OnSystemClockTimeUpdated() override; | |
| 50 void OnSystemClockCanSetTimeChanged(bool can_set_time) override; | |
| 51 void Refresh() override; | |
| 52 | |
| 53 void SetupLabelForTimeTray(views::Label* label); | |
| 54 void UpdateTimeFormat(); | |
| 55 | |
| 56 tray::TimeView* tray_view_; | |
| 57 SystemInfoDefaultView* default_view_; | |
| 58 LoginStatus login_status_; | |
| 59 | |
| 60 std::unique_ptr<SystemClockObserver> system_clock_observer_; | |
| 61 | |
| 62 DISALLOW_COPY_AND_ASSIGN(TraySystemInfo); | |
| 63 }; | |
| 64 | |
| 65 } // namespace ash | |
| 66 | |
| 67 #endif // ASH_COMMON_SYSTEM_DATE_TRAY_SYSTEM_INFO_H_ | |
| OLD | NEW |