#include "third_party/blink/renderer/modules/idle/idle_detector.h"
#include <utility>
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/mojom/idle/idle_manager.mojom-blink.h"
#include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_idle_options.h"
#include "third_party/blink/renderer/core/dom/abort_signal.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/execution_context/security_context.h"
#include "third_party/blink/renderer/modules/idle/idle_manager.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
namespace {
IdleManagerError;
const char kFeaturePolicyBlocked[] = …;
constexpr base::TimeDelta kMinimumThreshold = …;
constexpr base::TimeDelta kUserInputThreshold = …;
static_assert …;
}
class IdleDetector::StartAbortAlgorithm final : public AbortSignal::Algorithm { … };
IdleDetector* IdleDetector::Create(ScriptState* script_state) { … }
IdleDetector::IdleDetector(ExecutionContext* context)
: … { … }
IdleDetector::~IdleDetector() = default;
const AtomicString& IdleDetector::InterfaceName() const { … }
ExecutionContext* IdleDetector::GetExecutionContext() const { … }
bool IdleDetector::HasPendingActivity() const { … }
String IdleDetector::userState() const { … }
String IdleDetector::screenState() const { … }
ScriptPromise<V8PermissionState> IdleDetector::requestPermission(
ScriptState* script_state,
ExceptionState& exception_state) { … }
ScriptPromise<IDLUndefined> IdleDetector::start(
ScriptState* script_state,
const IdleOptions* options,
ExceptionState& exception_state) { … }
void IdleDetector::SetTaskRunnerForTesting(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const base::TickClock* tick_clock) { … }
void IdleDetector::Abort() { … }
void IdleDetector::OnMonitorDisconnected() { … }
void IdleDetector::OnAddMonitor(ScriptPromiseResolver<IDLUndefined>* resolver,
IdleManagerError error,
mojom::blink::IdleStatePtr state) { … }
void IdleDetector::Update(mojom::blink::IdleStatePtr state,
bool is_overridden_by_devtools) { … }
void IdleDetector::DispatchUserIdleEvent(TimerBase*) { … }
void IdleDetector::Trace(Visitor* visitor) const { … }
void IdleDetector::ContextDestroyed() { … }
void IdleDetector::Clear() { … }
}