Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(790)

Side by Side Diff: chrome/browser/chromeos/low_battery_observer.h

Issue 8347016: chromeos: Simplify power supply info in PowerLibrary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed copy error Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/time.h" 10 #include "base/time.h"
11 #include "chrome/browser/chromeos/cros/power_library.h" 11 #include "chrome/browser/chromeos/cros/power_library.h"
12 #include "chrome/browser/chromeos/notifications/system_notification.h" 12 #include "chrome/browser/chromeos/notifications/system_notification.h"
13 13
14 class Profile; 14 class Profile;
15 15
16 namespace chromeos { 16 namespace chromeos {
17 17
18 struct PowerStatus;
19
18 // The low battery observer displays a system notification when the battery 20 // The low battery observer displays a system notification when the battery
19 // is low. 21 // is low.
20 22
21 class LowBatteryObserver : public PowerLibrary::Observer { 23 class LowBatteryObserver : public PowerLibrary::Observer {
22 public: 24 public:
23 explicit LowBatteryObserver(Profile* profile); 25 explicit LowBatteryObserver(Profile* profile);
24 virtual ~LowBatteryObserver(); 26 virtual ~LowBatteryObserver();
25 27
26 private: 28 private:
27 virtual void PowerChanged(PowerLibrary* object); 29 virtual void PowerChanged(const PowerStatus& power_status);
28 virtual void SystemResumed() {} 30 virtual void SystemResumed() {}
29 31
30 void Show(base::TimeDelta remaining, bool urgent); 32 void Show(base::TimeDelta remaining, bool urgent);
31 void Hide(); 33 void Hide();
32 34
33 SystemNotification notification_; 35 SystemNotification notification_;
34 int remaining_; // Last displayed remaining time in minutes 36 int remaining_; // Last displayed remaining time in minutes
35 37
36 DISALLOW_COPY_AND_ASSIGN(LowBatteryObserver); 38 DISALLOW_COPY_AND_ASSIGN(LowBatteryObserver);
37 }; 39 };
38 40
39 } // namespace chromeos 41 } // namespace chromeos
40 42
41 #endif // CHROME_BROWSER_CHROMEOS_LOW_BATTERY_OBSERVER_H_ 43 #endif // CHROME_BROWSER_CHROMEOS_LOW_BATTERY_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698