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

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: Fix nits. 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
« no previous file with comments | « ash/ash_strings.grd ('k') | ash/system/power/power_status_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 class PowerStatusView : public views::View {
21 public:
22 enum ViewType {
23 VIEW_DEFAULT,
24 VIEW_NOTIFICATION
25 };
26
27 explicit PowerStatusView(ViewType view_type);
28 virtual ~PowerStatusView() {}
29
30 void UpdatePowerStatus(const PowerSupplyStatus& status);
31
32 // Overridden from views::View.
33 virtual gfx::Size GetPreferredSize() OVERRIDE;
34
35 private:
36 void LayoutDefaultView();
37 void LayoutNotificationView();
38 void UpdateText();
39 void UpdateIcon();
40 void Update();
41 void UpdateTextForDefaultView();
42 void UpdateTextForNotificationView();
43
44 // Overridden from views::View.
45 virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;
46
47 // labels used only for VIEW_NOTIFICATION.
48 views::Label* status_label_;
49 views::Label* time_label_;
50
51 // labels used only for VIEW_DEFAULT.
52 views::Label* time_status_label_;
53
54 views::ImageView* icon_;
55 ViewType view_type_;
56
57 PowerSupplyStatus supply_status_;
58
59 DISALLOW_COPY_AND_ASSIGN(PowerStatusView);
60 };
61
62 } // namespace internal
63 } // namespace ash
64
65 #endif // ASH_SYSTEM_POWER_POWER_STATUS_VIEW_H_
OLDNEW
« no previous file with comments | « ash/ash_strings.grd ('k') | ash/system/power/power_status_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698