| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_LOW_BATTERY_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOW_BATTERY_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOW_BATTERY_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOW_BATTERY_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/chromeos/cros/power_library.h" | 10 #include "chrome/browser/chromeos/cros/power_library.h" |
| 11 #include "chrome/browser/chromeos/notifications/system_notification.h" | 11 #include "chrome/browser/chromeos/notifications/system_notification.h" |
| 12 | 12 |
| 13 class Profile; | 13 class Profile; |
| 14 | 14 |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 | 16 |
| 17 // The low battery observer displays a system notification when the battery | 17 // The low battery observer displays a system notification when the battery |
| 18 // is low. | 18 // is low. |
| 19 | 19 |
| 20 class LowBatteryObserver : public PowerLibrary::Observer { | 20 class LowBatteryObserver : public PowerLibrary::Observer { |
| 21 public: | 21 public: |
| 22 explicit LowBatteryObserver(Profile* profile); | 22 explicit LowBatteryObserver(Profile* profile); |
| 23 virtual ~LowBatteryObserver(); | 23 virtual ~LowBatteryObserver(); |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 virtual void PowerChanged(PowerLibrary* object); | 26 virtual void PowerChanged(PowerLibrary* object); |
| 27 | 27 |
| 28 void Show(base::TimeDelta remaining); | 28 void Show(base::TimeDelta remaining, bool urgent); |
| 29 void Hide(); | 29 void Hide(); |
| 30 | 30 |
| 31 SystemNotification notification_; | 31 SystemNotification notification_; |
| 32 int remaining_; // Last displayed remaining time in minutes | 32 int remaining_; // Last displayed remaining time in minutes |
| 33 | 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(LowBatteryObserver); | 34 DISALLOW_COPY_AND_ASSIGN(LowBatteryObserver); |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 } // namespace chromeos | 37 } // namespace chromeos |
| 38 | 38 |
| 39 #endif // CHROME_BROWSER_CHROMEOS_LOW_BATTERY_OBSERVER_H_ | 39 #endif // CHROME_BROWSER_CHROMEOS_LOW_BATTERY_OBSERVER_H_ |
| 40 | 40 |
| OLD | NEW |