chromium/chrome/browser/ui/user_education/polling_idle_observer.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/user_education/polling_idle_observer.h"

#include <memory>
#include <optional>

#include "base/check.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "components/user_education/common/feature_promo_idle_observer.h"
#include "components/user_education/common/feature_promo_idle_policy.h"
#include "components/user_education/common/feature_promo_session_manager.h"
#include "components/user_education/common/user_education_features.h"
#include "ui/base/idle/idle.h"
#include "ui/base/idle/idle_polling_service.h"

namespace {
// Last active time is "stale" if it is significantly before the last time the
// idle state would have been polled. A state last active time means the
// browser is not actually active. There is a "fudge factor" of 50% or 2
// seconds (whichever is larger) to account for the low resolution of
// `ui::CalculateIdleTime()`.
static constexpr base::TimeDelta kStaleDataThreshold =;
}  // namespace

// Function called by `UserEducationServiceFactory` to create an idle observer.
std::unique_ptr<user_education::FeaturePromoIdleObserver>
CreatePollingIdleObserver() {}

PollingIdleObserver::PollingIdleObserver() = default;
PollingIdleObserver::~PollingIdleObserver() = default;

std::optional<base::Time> PollingIdleObserver::MaybeGetNewLastActiveTime()
    const {}

void PollingIdleObserver::StartObserving() {}

void PollingIdleObserver::OnIdleStateChange(
    const ui::IdlePollingService::State& state) {}

bool PollingIdleObserver::IsChromeActive() const {}