OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_SYSTEM_POWER_POWER_STATUS_VIEW_H_ | 5 #ifndef ASH_SYSTEM_POWER_POWER_STATUS_VIEW_H_ |
6 #define ASH_SYSTEM_POWER_POWER_STATUS_VIEW_H_ | 6 #define ASH_SYSTEM_POWER_POWER_STATUS_VIEW_H_ |
7 | 7 |
8 #include "ash/system/power/power_supply_status.h" | 8 #include "ash/system/power/power_supply_status.h" |
9 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 }; | 24 }; |
25 | 25 |
26 PowerStatusView(ViewType view_type, bool default_view_right_align); | 26 PowerStatusView(ViewType view_type, bool default_view_right_align); |
27 virtual ~PowerStatusView() {} | 27 virtual ~PowerStatusView() {} |
28 | 28 |
29 void UpdatePowerStatus(const PowerSupplyStatus& status); | 29 void UpdatePowerStatus(const PowerSupplyStatus& status); |
30 const string16& accessible_name() const { return accessible_name_; } | 30 const string16& accessible_name() const { return accessible_name_; } |
31 | 31 |
32 // Overridden from views::View. | 32 // Overridden from views::View. |
33 virtual gfx::Size GetPreferredSize() OVERRIDE; | 33 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 34 virtual int GetHeightForWidth(int width) OVERRIDE; |
34 virtual void Layout() OVERRIDE; | 35 virtual void Layout() OVERRIDE; |
35 | 36 |
36 private: | 37 private: |
37 void LayoutDefaultView(); | 38 void LayoutDefaultView(); |
38 void LayoutNotificationView(); | 39 void LayoutNotificationView(); |
39 void UpdateText(); | 40 void UpdateText(); |
40 void UpdateIcon(); | 41 void UpdateIcon(); |
41 void Update(); | 42 void Update(); |
42 void UpdateTextForDefaultView(); | 43 void UpdateTextForDefaultView(); |
43 void UpdateTextForNotificationView(); | 44 void UpdateTextForNotificationView(); |
(...skipping 27 matching lines...) Expand all Loading... |
71 | 72 |
72 string16 accessible_name_; | 73 string16 accessible_name_; |
73 | 74 |
74 DISALLOW_COPY_AND_ASSIGN(PowerStatusView); | 75 DISALLOW_COPY_AND_ASSIGN(PowerStatusView); |
75 }; | 76 }; |
76 | 77 |
77 } // namespace internal | 78 } // namespace internal |
78 } // namespace ash | 79 } // namespace ash |
79 | 80 |
80 #endif // ASH_SYSTEM_POWER_POWER_STATUS_VIEW_H_ | 81 #endif // ASH_SYSTEM_POWER_POWER_STATUS_VIEW_H_ |
OLD | NEW |