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

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

Issue 247663003: Date and Time dialog for when the clock isn't synced. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Observe system clock Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_SYSTEM_DATE_TRAY_DATE_H_ 5 #ifndef ASH_SYSTEM_DATE_TRAY_DATE_H_
6 #define ASH_SYSTEM_DATE_TRAY_DATE_H_ 6 #define ASH_SYSTEM_DATE_TRAY_DATE_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/system/date/clock_observer.h" 9 #include "ash/system/date/clock_observer.h"
10 #include "ash/system/tray/system_tray_item.h" 10 #include "ash/system/tray/system_tray_item.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 12
13 namespace views { 13 namespace views {
14 class Label; 14 class Label;
15 } 15 }
16 16
17 namespace ash { 17 namespace ash {
18 class DateDefaultView; 18 class DateDefaultView;
19 #if defined(OS_CHROMEOS) 19 #if defined(OS_CHROMEOS)
20 class SystemClockObserver; 20 class SystemClockObserver;
21 #endif 21 #endif
22 22
23 namespace tray { 23 namespace tray {
24 class TimeView; 24 class TimeView;
25 } 25 }
26 26
27 class ASH_EXPORT TrayDate : public SystemTrayItem, public ClockObserver { 27 class ASH_EXPORT TrayDate : public SystemTrayItem, public ClockObserver {
28 public: 28 public:
29 enum ClockLayout { 29 enum ClockLayout {
30 HORIZONTAL_CLOCK, 30 HORIZONTAL_CLOCK,
31 VERTICAL_CLOCK, 31 VERTICAL_CLOCK,
32 };
stevenjb 2014/04/25 22:53:31 nit: WS
michaelpg 2014/04/25 23:50:29 Done.
33 enum DateAction {
34 NONE,
35 SET_SYSTEM_TIME,
36 SHOW_DATE_SETTINGS,
32 }; 37 };
stevenjb 2014/04/25 22:53:31 nit: please add WS
michaelpg 2014/04/25 23:50:29 Done.
33 explicit TrayDate(SystemTray* system_tray); 38 explicit TrayDate(SystemTray* system_tray);
34 virtual ~TrayDate(); 39 virtual ~TrayDate();
35 40
36 // Returns view for help button if it is exists. Returns NULL otherwise. 41 // Returns view for help button if it is exists. Returns NULL otherwise.
37 views::View* GetHelpButtonView() const; 42 views::View* GetHelpButtonView() const;
38 43
39 const tray::TimeView* GetTimeTrayForTesting() const; 44 const tray::TimeView* GetTimeTrayForTesting() const;
40 const DateDefaultView* GetDefaultViewForTesting() const; 45 const DateDefaultView* GetDefaultViewForTesting() const;
41 views::View* CreateDefaultViewForTesting(user::LoginStatus status); 46 views::View* CreateDefaultViewForTesting(user::LoginStatus status);
42 47
43 private: 48 private:
44 // Overridden from SystemTrayItem. 49 // Overridden from SystemTrayItem.
45 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; 50 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
46 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; 51 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
47 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; 52 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
48 virtual void DestroyTrayView() OVERRIDE; 53 virtual void DestroyTrayView() OVERRIDE;
49 virtual void DestroyDefaultView() OVERRIDE; 54 virtual void DestroyDefaultView() OVERRIDE;
50 virtual void DestroyDetailedView() OVERRIDE; 55 virtual void DestroyDetailedView() OVERRIDE;
51 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; 56 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE;
52 virtual void UpdateAfterShelfAlignmentChange( 57 virtual void UpdateAfterShelfAlignmentChange(
53 ShelfAlignment alignment) OVERRIDE; 58 ShelfAlignment alignment) OVERRIDE;
54 59
55 // Overridden from ClockObserver. 60 // Overridden from ClockObserver.
56 virtual void OnDateFormatChanged() OVERRIDE; 61 virtual void OnDateFormatChanged() OVERRIDE;
57 virtual void OnSystemClockTimeUpdated() OVERRIDE; 62 virtual void OnSystemClockTimeUpdated() OVERRIDE;
63 virtual void OnSystemClockCanSetTimeChanged(bool can_set_time) OVERRIDE;
58 virtual void Refresh() OVERRIDE; 64 virtual void Refresh() OVERRIDE;
59 65
60 void SetupLabelForTimeTray(views::Label* label); 66 void SetupLabelForTimeTray(views::Label* label);
61 67
62 tray::TimeView* time_tray_; 68 tray::TimeView* time_tray_;
63 DateDefaultView* default_view_; 69 DateDefaultView* default_view_;
70 user::LoginStatus login_status_;
64 71
65 #if defined(OS_CHROMEOS) 72 #if defined(OS_CHROMEOS)
66 scoped_ptr<SystemClockObserver> system_clock_observer_; 73 scoped_ptr<SystemClockObserver> system_clock_observer_;
67 #endif 74 #endif
68 75
69 DISALLOW_COPY_AND_ASSIGN(TrayDate); 76 DISALLOW_COPY_AND_ASSIGN(TrayDate);
70 }; 77 };
71 78
72 } // namespace ash 79 } // namespace ash
73 80
74 #endif // ASH_SYSTEM_DATE_TRAY_DATE_H_ 81 #endif // ASH_SYSTEM_DATE_TRAY_DATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698