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

Side by Side Diff: ash/system/power/power_status_view.h

Issue 10540041: Add battery status to settings row in uber tray bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not show settings if user is not logined in or screen is locked. Created 8 years, 6 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
(Empty)
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.
4
5 #ifndef ASH_SYSTEM_POWER_POWER_STATUS_VIEW_H_
6 #define ASH_SYSTEM_POWER_POWER_STATUS_VIEW_H_
7 #pragma once
8
9 #include "ash/system/power/power_supply_status.h"
10 #include "ui/views/view.h"
11
12 namespace views {
13 class ImageView;
14 class Label;
15 }
16
17 namespace ash {
18 namespace internal {
19
20 // This view is used only for the popup.
21 class PowerStatusView : public views::View {
22 public:
23 enum ViewType {
24 VIEW_DEFAULT,
sadrul 2012/06/08 13:22:39 too much indentation here
jennyz 2012/06/08 16:48:03 Done.
25 VIEW_NOTIFICATION
26 };
27
28 explicit PowerStatusView(ViewType view_type);
29 virtual ~PowerStatusView() {}
30
31 void UpdatePowerStatus(const PowerSupplyStatus& status);
32
33 // Overridden from views::View.
34 virtual gfx::Size GetPreferredSize() OVERRIDE;
35
36 private:
37 void LayoutDefaultView();
38 void LayoutNotificationView();
39 void UpdateText();
40 void UpdateIcon();
41 void Update();
42 void UpdateTextForDefaultView();
43 void UpdateTextForNotificationView();
44
45 // Overridden from views::View.
46 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;
47
48 // labels used only for VIEW_NOTIFICATION.
49 views::Label* status_label_;
50 views::Label* time_label_;
51
52 // labels used only for VIEW_DEFAULT.
53 views::Label* time_status_label_;
54
55 views::ImageView* icon_;
56 ViewType view_type_;
57
58 PowerSupplyStatus supply_status_;
59
60 DISALLOW_COPY_AND_ASSIGN(PowerStatusView);
61 };
62
63 } // namespace internal
64 } // namespace ash
65
66 #endif // ASH_SYSTEM_POWER_POWER_STATUS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698