diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-01 17:59:38 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-01 17:59:38 +0000 |
commit | 4d9ae4ab9dd6d4f27c5cef5481f41979b3d58d1b (patch) | |
tree | 9978d5c639d3906ce700cc687170a6800243001b /base/system_monitor.h | |
parent | 09d38ad48a2273d2e677e78d4828fa2c8bc65797 (diff) | |
download | chromium_src-4d9ae4ab9dd6d4f27c5cef5481f41979b3d58d1b.zip chromium_src-4d9ae4ab9dd6d4f27c5cef5481f41979b3d58d1b.tar.gz chromium_src-4d9ae4ab9dd6d4f27c5cef5481f41979b3d58d1b.tar.bz2 |
Simplify the PowerObserver API by removing unneeded args and providing default implementations.
This also makes all the subclasses use the same code to add/remove observers.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/244054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/system_monitor.h')
-rw-r--r-- | base/system_monitor.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/base/system_monitor.h b/base/system_monitor.h index aeec42b..71d8436 100644 --- a/base/system_monitor.h +++ b/base/system_monitor.h @@ -1,4 +1,4 @@ -// Copyright (c) 2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -44,7 +44,7 @@ class SystemMonitor { // Is the computer currently on battery power. // Can be called on any thread. - bool BatteryPower() { + bool BatteryPower() const { // Using a lock here is not necessary for just a bool. return battery_in_use_; } @@ -65,13 +65,13 @@ class SystemMonitor { public: // Notification of a change in power status of the computer, such // as from switching between battery and A/C power. - virtual void OnPowerStateChange(SystemMonitor*) = 0; + virtual void OnPowerStateChange(bool on_battery_power) {} // Notification that the system is suspending. - virtual void OnSuspend(SystemMonitor*) = 0; + virtual void OnSuspend() {} // Notification that the system is resuming. - virtual void OnResume(SystemMonitor*) = 0; + virtual void OnResume() {} }; // Add a new observer. |