| 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" |
| 11 #include "views/controls/menu/menu_delegate.h" | 11 #include "views/controls/menu/menu_delegate.h" |
| 12 #include "views/controls/menu/view_menu_delegate.h" | 12 #include "views/controls/menu/view_menu_delegate.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class TimeDelta; | 15 class TimeDelta; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace views { |
| 19 class MenuRunner; |
| 20 } |
| 21 |
| 18 class SkBitmap; | 22 class SkBitmap; |
| 19 | 23 |
| 20 namespace chromeos { | 24 namespace chromeos { |
| 21 | 25 |
| 22 // The power menu button in the status area. | 26 // The power menu button in the status area. |
| 23 // This class will handle getting the power status and populating the menu. | 27 // This class will handle getting the power status and populating the menu. |
| 24 class PowerMenuButton : public StatusAreaButton, | 28 class PowerMenuButton : public StatusAreaButton, |
| 25 public views::MenuDelegate, | 29 public views::MenuDelegate, |
| 26 public views::ViewMenuDelegate, | 30 public views::ViewMenuDelegate, |
| 27 public PowerLibrary::Observer { | 31 public PowerLibrary::Observer { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 bool line_power_on_; | 72 bool line_power_on_; |
| 69 double battery_percentage_; | 73 double battery_percentage_; |
| 70 string16 percentage_text_; | 74 string16 percentage_text_; |
| 71 int battery_index_; | 75 int battery_index_; |
| 72 base::TimeDelta battery_time_to_full_; | 76 base::TimeDelta battery_time_to_full_; |
| 73 base::TimeDelta battery_time_to_empty_; | 77 base::TimeDelta battery_time_to_empty_; |
| 74 | 78 |
| 75 // 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. |
| 76 StatusView* status_; | 80 StatusView* status_; |
| 77 | 81 |
| 78 // The currently showing menu. NULL if menu is not being displayed. | 82 // If non-null the menu is showing. |
| 79 views::MenuItemView* menu_; | 83 views::MenuRunner* menu_runner_; |
| 80 | 84 |
| 81 DISALLOW_COPY_AND_ASSIGN(PowerMenuButton); | 85 DISALLOW_COPY_AND_ASSIGN(PowerMenuButton); |
| 82 }; | 86 }; |
| 83 | 87 |
| 84 } // namespace chromeos | 88 } // namespace chromeos |
| 85 | 89 |
| 86 #endif // CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_ | 90 #endif // CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_ |
| OLD | NEW |