summaryrefslogtreecommitdiffstats
path: root/ash/system/date/date_default_view.h
blob: 2efcdf84f358be281dd459072f85c317a2a01f98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_
#define ASH_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_

#include "ash/ash_export.h"
#include "ash/system/chromeos/shutdown_policy_observer.h"
#include "ash/system/user/login_status.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/view.h"

namespace ash {
namespace tray {
class DateView;
}  // namespace tray

class TrayPopupHeaderButton;

class ASH_EXPORT DateDefaultView : public views::View,
                                   public views::ButtonListener,
                                   public ash::ShutdownPolicyObserver {
 public:
  explicit DateDefaultView(ash::user::LoginStatus login);

  ~DateDefaultView() override;

  views::View* GetHelpButtonView();
  const views::View* GetShutdownButtonViewForTest() const;

  tray::DateView* GetDateView();
  const tray::DateView* GetDateView() const;

  // ash::ShutdownPolicyObserver:
  void OnShutdownPolicyChanged(bool reboot_on_shutdown) override;

 private:
  // Overridden from views::ButtonListener.
  void ButtonPressed(views::Button* sender, const ui::Event& event) override;

  TrayPopupHeaderButton* help_button_;
  TrayPopupHeaderButton* shutdown_button_;
  TrayPopupHeaderButton* lock_button_;
  tray::DateView* date_view_;

  base::WeakPtrFactory<DateDefaultView> weak_factory_;

  DISALLOW_COPY_AND_ASSIGN(DateDefaultView);
};

}  // namespace ash

#endif  // ASH_SYSTEM_DATE_DATE_DEFAULT_VIEW_H_