Elim cr-checkbox
[chromium-blink-merge.git] / ash / system / chromeos / power / power_status_view.h
bloba24ecc8c90974c012e499509a124ab915de37e65
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
3 // found in the LICENSE file.
5 #ifndef ASH_SYSTEM_CHROMEOS_POWER_POWER_STATUS_VIEW_H_
6 #define ASH_SYSTEM_CHROMEOS_POWER_POWER_STATUS_VIEW_H_
8 #include "ash/ash_export.h"
9 #include "ash/system/chromeos/power/power_status.h"
10 #include "ui/views/view.h"
12 namespace views {
13 class ImageView;
14 class Label;
17 namespace ash {
19 class ASH_EXPORT PowerStatusView : public views::View,
20 public PowerStatus::Observer {
21 public:
22 PowerStatusView(bool default_view_right_align);
23 ~PowerStatusView() override;
25 // Overridden from views::View.
26 gfx::Size GetPreferredSize() const override;
27 int GetHeightForWidth(int width) const override;
28 void Layout() override;
30 // Overridden from PowerStatus::Observer.
31 void OnPowerStatusChanged() override;
33 private:
34 friend class PowerStatusViewTest;
36 void LayoutView();
37 void UpdateText();
39 // Overridden from views::View.
40 void ChildPreferredSizeChanged(views::View* child) override;
42 // Layout default view UI items on the right side of system tray pop up item
43 // if true; otherwise, layout the UI items on the left side.
44 bool default_view_right_align_;
46 views::Label* time_status_label_;
47 views::Label* percentage_label_;
49 // Battery status indicator icon.
50 views::ImageView* icon_;
52 DISALLOW_COPY_AND_ASSIGN(PowerStatusView);
55 } // namespace ash
57 #endif // ASH_SYSTEM_CHROMEOS_POWER_POWER_STATUS_VIEW_H_