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

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

Issue 2497123002: chromeos: Move device shutdown handling out of chrome into ash (Closed)
Patch Set: rebase Created 4 years, 1 month 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
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_COMMON_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_ 5 #ifndef ASH_COMMON_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_
6 #define ASH_COMMON_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_ 6 #define ASH_COMMON_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/common/login_status.h" 9 #include "ash/common/login_status.h"
10 #include "ash/common/system/chromeos/shutdown_policy_observer.h"
11 #include "base/macros.h" 10 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h"
13 #include "ui/views/controls/button/button.h" 11 #include "ui/views/controls/button/button.h"
14 #include "ui/views/view.h" 12 #include "ui/views/view.h"
15 13
16 namespace ash { 14 namespace ash {
17 namespace tray { 15 namespace tray {
18 class DateView; 16 class DateView;
19 } // namespace tray 17 } // namespace tray
20 18
21 class SystemTrayItem; 19 class SystemTrayItem;
22 class TrayPopupHeaderButton; 20 class TrayPopupHeaderButton;
23 21
24 // The system tray bubble view with the date and buttons for help, lock and 22 // The system tray bubble view with the date and buttons for help, lock and
25 // shutdown. 23 // shutdown.
26 // TODO(tdanderson): Remove this class once material design is enabled by 24 // TODO(tdanderson): Remove this class once material design is enabled by
27 // default. See crbug.com/614453. 25 // default. See crbug.com/614453.
28 class ASH_EXPORT DateDefaultView : public views::View, 26 class ASH_EXPORT DateDefaultView : public views::View,
29 public views::ButtonListener, 27 public views::ButtonListener {
30 public ShutdownPolicyObserver {
31 public: 28 public:
32 DateDefaultView(SystemTrayItem* owner, LoginStatus login); 29 DateDefaultView(SystemTrayItem* owner, LoginStatus login);
33 30
34 ~DateDefaultView() override; 31 ~DateDefaultView() override;
35 32
36 views::View* GetHelpButtonView(); 33 views::View* GetHelpButtonView();
37 const views::View* GetShutdownButtonViewForTest() const; 34 const views::View* GetShutdownButtonViewForTest() const;
38 35
39 tray::DateView* GetDateView(); 36 tray::DateView* GetDateView();
40 const tray::DateView* GetDateView() const; 37 const tray::DateView* GetDateView() const;
41 38
42 // ash::ShutdownPolicyObserver:
43 void OnShutdownPolicyChanged(bool reboot_on_shutdown) override;
44
45 private: 39 private:
46 // Overridden from views::ButtonListener. 40 // Overridden from views::ButtonListener.
47 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 41 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
48 42
49 TrayPopupHeaderButton* help_button_; 43 TrayPopupHeaderButton* help_button_;
50 TrayPopupHeaderButton* shutdown_button_; 44 TrayPopupHeaderButton* shutdown_button_;
51 TrayPopupHeaderButton* lock_button_; 45 TrayPopupHeaderButton* lock_button_;
52 tray::DateView* date_view_; 46 tray::DateView* date_view_;
53 47
54 base::WeakPtrFactory<DateDefaultView> weak_factory_;
55
56 DISALLOW_COPY_AND_ASSIGN(DateDefaultView); 48 DISALLOW_COPY_AND_ASSIGN(DateDefaultView);
57 }; 49 };
58 50
59 } // namespace ash 51 } // namespace ash
60 52
61 #endif // ASH_COMMON_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_ 53 #endif // ASH_COMMON_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/shutdown_policy_observer.h ('k') | ash/common/system/date/date_default_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698