| OLD | NEW |
| (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 CHROME_BROWSER_CHROMEOS_POWER_LOW_BATTERY_OBSERVER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_POWER_LOW_BATTERY_OBSERVER_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "base/time.h" | |
| 11 #include "chrome/browser/chromeos/notifications/system_notification.h" | |
| 12 #include "chromeos/dbus/power_manager_client.h" | |
| 13 | |
| 14 class Profile; | |
| 15 | |
| 16 namespace chromeos { | |
| 17 | |
| 18 // Displays a system notification when the battery is low. | |
| 19 class LowBatteryObserver : public PowerManagerClient::Observer { | |
| 20 public: | |
| 21 explicit LowBatteryObserver(Profile* profile); | |
| 22 virtual ~LowBatteryObserver(); | |
| 23 | |
| 24 private: | |
| 25 virtual void PowerChanged(const PowerSupplyStatus& power_status) OVERRIDE; | |
| 26 | |
| 27 void Show(base::TimeDelta remaining, bool urgent); | |
| 28 void Hide(); | |
| 29 | |
| 30 SystemNotification notification_; | |
| 31 int remaining_; // Last displayed remaining time in minutes | |
| 32 | |
| 33 DISALLOW_COPY_AND_ASSIGN(LowBatteryObserver); | |
| 34 }; | |
| 35 | |
| 36 } // namespace chromeos | |
| 37 | |
| 38 #endif // CHROME_BROWSER_CHROMEOS_POWER_LOW_BATTERY_OBSERVER_H_ | |
| OLD | NEW |