OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DATE_DEFAULT_VIEW_H_ | 5 #ifndef ASH_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_ |
6 #define ASH_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_ | 6 #define ASH_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/system/chromeos/shutdown_policy_observer.h" | |
9 #include "ash/system/user/login_status.h" | 10 #include "ash/system/user/login_status.h" |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | |
11 #include "ui/views/controls/button/button.h" | 13 #include "ui/views/controls/button/button.h" |
12 #include "ui/views/view.h" | 14 #include "ui/views/view.h" |
13 | 15 |
14 namespace ash { | 16 namespace ash { |
15 namespace tray { | 17 namespace tray { |
16 class DateView; | 18 class DateView; |
17 } // namespace tray | 19 } // namespace tray |
18 | 20 |
19 class TrayPopupHeaderButton; | 21 class TrayPopupHeaderButton; |
20 | 22 |
21 class ASH_EXPORT DateDefaultView : public views::View, | 23 class ASH_EXPORT DateDefaultView : public views::View, |
22 public views::ButtonListener { | 24 public views::ButtonListener, |
25 public ash::ShutdownPolicyObserver { | |
23 public: | 26 public: |
24 explicit DateDefaultView(ash::user::LoginStatus login); | 27 explicit DateDefaultView(ash::user::LoginStatus login); |
25 | 28 |
26 ~DateDefaultView() override; | 29 ~DateDefaultView() override; |
27 | 30 |
28 views::View* GetHelpButtonView(); | 31 views::View* GetHelpButtonView(); |
29 | 32 |
30 tray::DateView* GetDateView(); | 33 tray::DateView* GetDateView(); |
31 const tray::DateView* GetDateView() const; | 34 const tray::DateView* GetDateView() const; |
32 | 35 |
36 // ash::ShutdownPolicyObserver: | |
37 void OnShutdownPolicyChanged(bool reboot_on_shutdown) override; | |
38 | |
33 private: | 39 private: |
34 // Overridden from views::ButtonListener. | 40 // Overridden from views::ButtonListener. |
35 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 41 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
36 | 42 |
37 TrayPopupHeaderButton* help_; | 43 TrayPopupHeaderButton* help_; |
38 TrayPopupHeaderButton* shutdown_; | 44 TrayPopupHeaderButton* shutdown_; |
Daniel Erat
2015/01/07 16:18:40
could you rename these to help_button_, shutdown_b
cschuet (SLOW)
2015/01/13 10:38:28
Done.
| |
39 TrayPopupHeaderButton* lock_; | 45 TrayPopupHeaderButton* lock_; |
40 tray::DateView* date_view_; | 46 tray::DateView* date_view_; |
41 | 47 |
48 base::WeakPtrFactory<DateDefaultView> weak_factory_; | |
49 | |
42 DISALLOW_COPY_AND_ASSIGN(DateDefaultView); | 50 DISALLOW_COPY_AND_ASSIGN(DateDefaultView); |
43 }; | 51 }; |
44 | 52 |
45 } // namespace ash | 53 } // namespace ash |
46 | 54 |
47 #endif // ASH_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_ | 55 #endif // ASH_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_ |
OLD | NEW |