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

Side by Side Diff: chrome/browser/chromeos/cros/power_library.h

Issue 6486007: Introducing ResumeLibrary to track system resume signal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ResumeLibrary removed, its functions moved to PowerLibrary Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_CROS_POWER_LIBRARY_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_
6 #define CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ 6 #define CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/observer_list.h" 9 #include "base/observer_list.h"
10 #include "base/singleton.h" 10 #include "base/singleton.h"
11 #include "base/time.h" 11 #include "base/time.h"
12 #include "third_party/cros/chromeos_power.h" 12 #include "third_party/cros/chromeos_power.h"
13 13
14 namespace chromeos { 14 namespace chromeos {
15 15
16 // This interface defines interaction with the ChromeOS power library APIs. 16 // This interface defines interaction with the ChromeOS power library APIs.
17 // Classes can add themselves as observers. Users can get an instance of this 17 // Classes can add themselves as observers. Users can get an instance of this
18 // library class like this: chromeos::CrosLibrary::Get()->GetPowerLibrary() 18 // library class like this: chromeos::CrosLibrary::Get()->GetPowerLibrary()
19 class PowerLibrary { 19 class PowerLibrary {
20 public: 20 public:
21 class Observer { 21 class Observer {
22 public: 22 public:
23 virtual void PowerChanged(PowerLibrary* obj) = 0; 23 virtual void PowerChanged(PowerLibrary* obj) = 0;
24 virtual void SystemResumed() = 0;
24 }; 25 };
25 virtual ~PowerLibrary() {} 26 virtual ~PowerLibrary() {}
26 virtual void AddObserver(Observer* observer) = 0; 27 virtual void AddObserver(Observer* observer) = 0;
27 virtual void RemoveObserver(Observer* observer) = 0; 28 virtual void RemoveObserver(Observer* observer) = 0;
28 // Whether or not the line power is connected. 29 // Whether or not the line power is connected.
29 virtual bool line_power_on() const = 0; 30 virtual bool line_power_on() const = 0;
30 31
31 // Whether or not the battery is fully charged.. 32 // Whether or not the battery is fully charged..
32 virtual bool battery_fully_charged() const = 0; 33 virtual bool battery_fully_charged() const = 0;
33 34
(...skipping 19 matching lines...) Expand all
53 virtual void RequestShutdown() = 0; 54 virtual void RequestShutdown() = 0;
54 55
55 // Factory function, creates a new instance and returns ownership. 56 // Factory function, creates a new instance and returns ownership.
56 // For normal usage, access the singleton via CrosLibrary::Get(). 57 // For normal usage, access the singleton via CrosLibrary::Get().
57 static PowerLibrary* GetImpl(bool stub); 58 static PowerLibrary* GetImpl(bool stub);
58 }; 59 };
59 60
60 } // namespace chromeos 61 } // namespace chromeos
61 62
62 #endif // CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ 63 #endif // CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros/power_library.cc » ('j') | chrome/browser/chromeos/cros/power_library.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698