OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_ |
6 #define CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/chromeos/cros/power_library.h" | 9 #include "chrome/browser/chromeos/cros/power_library.h" |
10 #include "chrome/browser/chromeos/status/status_area_button.h" | 10 #include "chrome/browser/chromeos/status/status_area_button.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 public PowerLibrary::Observer { | 31 public PowerLibrary::Observer { |
32 public: | 32 public: |
33 explicit PowerMenuButton(StatusAreaHost* host); | 33 explicit PowerMenuButton(StatusAreaHost* host); |
34 virtual ~PowerMenuButton(); | 34 virtual ~PowerMenuButton(); |
35 | 35 |
36 // views::MenuDelegate implementation. | 36 // views::MenuDelegate implementation. |
37 virtual string16 GetLabel(int id) const; | 37 virtual string16 GetLabel(int id) const; |
38 virtual bool IsCommandEnabled(int id) const; | 38 virtual bool IsCommandEnabled(int id) const; |
39 | 39 |
40 // PowerLibrary::Observer implementation. | 40 // PowerLibrary::Observer implementation. |
41 virtual void PowerChanged(PowerLibrary* obj); | 41 virtual void PowerChanged(const PowerSupplyStatus& power_status); |
42 virtual void SystemResumed() {} | 42 virtual void SystemResumed() {} |
43 | 43 |
44 int battery_index() const { return battery_index_; } | 44 int battery_index() const { return battery_index_; } |
45 | 45 |
46 protected: | 46 protected: |
47 virtual int icon_width(); | 47 virtual int icon_width(); |
48 | 48 |
49 private: | 49 private: |
50 class StatusView; | 50 class StatusView; |
51 | 51 |
(...skipping 12 matching lines...) Expand all Loading... |
64 // Update Battery time. Try to make it monotonically decreasing unless | 64 // Update Battery time. Try to make it monotonically decreasing unless |
65 // there's a large delta. | 65 // there's a large delta. |
66 void UpdateBatteryTime(base::TimeDelta* previous, | 66 void UpdateBatteryTime(base::TimeDelta* previous, |
67 const base::TimeDelta& current); | 67 const base::TimeDelta& current); |
68 | 68 |
69 // Stored data gathered from CrosLibrary::PowerLibrary. | 69 // Stored data gathered from CrosLibrary::PowerLibrary. |
70 bool battery_is_present_; | 70 bool battery_is_present_; |
71 bool line_power_on_; | 71 bool line_power_on_; |
72 double battery_percentage_; | 72 double battery_percentage_; |
73 int battery_index_; | 73 int battery_index_; |
| 74 PowerSupplyStatus power_status_; |
| 75 |
74 base::TimeDelta battery_time_to_full_; | 76 base::TimeDelta battery_time_to_full_; |
75 base::TimeDelta battery_time_to_empty_; | 77 base::TimeDelta battery_time_to_empty_; |
76 | 78 |
77 // The currently showing status view. NULL if menu is not being displayed. | 79 // The currently showing status view. NULL if menu is not being displayed. |
78 StatusView* status_; | 80 StatusView* status_; |
79 | 81 |
80 // If non-null the menu is showing. | 82 // If non-null the menu is showing. |
81 scoped_ptr<views::MenuRunner> menu_runner_; | 83 scoped_ptr<views::MenuRunner> menu_runner_; |
82 | 84 |
83 DISALLOW_COPY_AND_ASSIGN(PowerMenuButton); | 85 DISALLOW_COPY_AND_ASSIGN(PowerMenuButton); |
84 }; | 86 }; |
85 | 87 |
86 } // namespace chromeos | 88 } // namespace chromeos |
87 | 89 |
88 #endif // CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_ | 90 #endif // CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_ |
OLD | NEW |