blob: 497e7d39e3cadffdfca3bb8761fc64f78b17913f [file] [log] [blame]
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Use the <code>chrome.power</code> API to override the system's power
// management features.
namespace power {
callback VoidCallback = void ();
[noinline_doc] enum Level {
// Prevents the system from sleeping in response to user inactivity.
system,
// Prevents the display from being turned off or dimmed, or the system
// from sleeping in response to user inactivity.
display
};
interface Functions {
// Requests that power management be temporarily disabled. |level|
// describes the degree to which power management should be disabled.
// If a request previously made by the same app is still active, it
// will be replaced by the new request.
static void requestKeepAwake(Level level);
// Releases a request previously made via requestKeepAwake().
static void releaseKeepAwake();
// Reports a user activity in order to awake the screen from a dimmed or
// turned off state or from a screensaver. Exits the screensaver if it is
// currently active.
[platforms=("chromeos", "lacros")] static void reportActivity(
optional VoidCallback callback);
};
};