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

Unified Diff: chromeos/power/power_state_override.h

Issue 12775019: chromeos: Remove PowerStateOverride. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more feedback Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/power_policy_controller_unittest.cc ('k') | chromeos/power/power_state_override.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/power/power_state_override.h
diff --git a/chromeos/power/power_state_override.h b/chromeos/power/power_state_override.h
deleted file mode 100644
index 08e31ee669c8b0cb2cef393e56d21e553fc5d744..0000000000000000000000000000000000000000
--- a/chromeos/power/power_state_override.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2012 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.
-
-#ifndef CHROMEOS_POWER_POWER_STATE_OVERRIDE_H_
-#define CHROMEOS_POWER_POWER_STATE_OVERRIDE_H_
-
-#include "base/basictypes.h"
-#include "base/memory/weak_ptr.h"
-#include "base/timer.h"
-#include "chromeos/chromeos_export.h"
-#include "chromeos/dbus/dbus_thread_manager_observer.h"
-
-namespace chromeos {
-
-class DBusThreadManager;
-
-// This class overrides the current power state on the machine, disabling
-// a set of power management features.
-class CHROMEOS_EXPORT PowerStateOverride
- : public base::RefCountedThreadSafe<PowerStateOverride>,
- public DBusThreadManagerObserver {
- public:
- enum Mode {
- // Blocks the screen from being dimmed or blanked due to user inactivity.
- // Also implies BLOCK_SYSTEM_SUSPEND.
- BLOCK_DISPLAY_SLEEP,
-
- // Blocks the system from being suspended due to user inactivity.
- BLOCK_SYSTEM_SUSPEND,
- };
-
- explicit PowerStateOverride(Mode mode);
-
- // DBusThreadManagerObserver implementation:
- virtual void OnDBusThreadManagerDestroying(DBusThreadManager* manager)
- OVERRIDE;
-
- private:
- friend class base::RefCountedThreadSafe<PowerStateOverride>;
-
- // This destructor cancels the current power state override. There might be
- // a very slight delay between the the last reference to an instance being
- // released and the power state override being canceled. This is only in
- // the case that the current instance has JUST been created and ChromeOS
- // hasn't had a chance to service the initial power override request yet.
- virtual ~PowerStateOverride();
-
- // Callback from RequestPowerStateOverride which receives our request_id.
- void SetRequestId(uint32 request_id);
-
- // Actually make a call to power manager; we need this to be able to post a
- // delayed task since we cannot call back into power manager from Heartbeat
- // since the last request has just been completed at that point.
- void CallRequestPowerStateOverrides();
-
- // Asks the power manager to cancel |request_id_| and sets it to zero.
- // Does nothing if it's already zero.
- void CancelRequest();
-
- // Bitmap containing requested override types from
- // PowerManagerClient::PowerStateOverrideType.
- uint32 override_types_;
-
- // Outstanding override request ID, or 0 if there is no outstanding request.
- uint32 request_id_;
-
- // Periodically invokes CallRequestPowerStateOverrides() to refresh the
- // override.
- base::RepeatingTimer<PowerStateOverride> heartbeat_;
-
- DBusThreadManager* dbus_thread_manager_; // not owned
-
- DISALLOW_COPY_AND_ASSIGN(PowerStateOverride);
-};
-
-} // namespace chromeos
-
-#endif // CHROMEOS_POWER_POWER_STATE_OVERRIDE_H_
« no previous file with comments | « chromeos/dbus/power_policy_controller_unittest.cc ('k') | chromeos/power/power_state_override.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698