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

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

Issue 339013: cros: doing dbus stuff on the file thread==disaster. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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 7
8 #include "base/observer_list.h" 8 #include "base/observer_list.h"
9 #include "base/singleton.h" 9 #include "base/singleton.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 CrosPowerLibrary(); 50 CrosPowerLibrary();
51 ~CrosPowerLibrary(); 51 ~CrosPowerLibrary();
52 52
53 // This method is called when there's a change in power status. 53 // This method is called when there's a change in power status.
54 // This method is called on a background thread. 54 // This method is called on a background thread.
55 static void PowerStatusChangedHandler(void* object, 55 static void PowerStatusChangedHandler(void* object,
56 const chromeos::PowerStatus& status); 56 const chromeos::PowerStatus& status);
57 57
58 // This methods starts the monitoring of power changes. 58 // This methods starts the monitoring of power changes.
59 // It should be called on a background thread. 59 void Init();
60 void InitOnBackgroundThread();
61 60
62 // Called by the handler to update the power status. 61 // Called by the handler to update the power status.
63 // This will notify all the Observers. 62 // This will notify all the Observers.
64 void UpdatePowerStatus(const chromeos::PowerStatus& status); 63 void UpdatePowerStatus(const chromeos::PowerStatus& status);
65 64
66 ObserverList<Observer> observers_; 65 ObserverList<Observer> observers_;
67 66
68 // A reference to the battery power api, to allow callbacks when the battery 67 // A reference to the battery power api, to allow callbacks when the battery
69 // status changes. 68 // status changes.
70 chromeos::PowerStatusConnection power_status_connection_; 69 chromeos::PowerStatusConnection power_status_connection_;
71 70
72 // The latest power status. 71 // The latest power status.
73 chromeos::PowerStatus status_; 72 chromeos::PowerStatus status_;
74 73
75 DISALLOW_COPY_AND_ASSIGN(CrosPowerLibrary); 74 DISALLOW_COPY_AND_ASSIGN(CrosPowerLibrary);
76 }; 75 };
77 76
78 #endif // CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ 77 #endif // CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros_network_library.cc ('k') | chrome/browser/chromeos/cros_power_library.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698