#include "chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller.h"
#include <algorithm>
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/time/default_clock.h"
#include "base/time/default_tick_clock.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/lifetime/application_lifetime_desktop.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
#include "chrome/browser/background/background_mode_manager.h"
#endif
namespace {
enum class RelaunchNotificationSetting { … };
RelaunchNotificationSetting ReadPreference() { … }
}
RelaunchNotificationController::RelaunchNotificationController(
UpgradeDetector* upgrade_detector)
: … { … }
RelaunchNotificationController::~RelaunchNotificationController() { … }
constexpr base::TimeDelta RelaunchNotificationController::kRelaunchGracePeriod;
RelaunchNotificationController::RelaunchNotificationController(
UpgradeDetector* upgrade_detector,
const base::Clock* clock,
const base::TickClock* tick_clock)
: … { … }
void RelaunchNotificationController::OnUpgradeRecommended() { … }
void RelaunchNotificationController::OnRelaunchOverriddenToRequired(
bool overridden) { … }
void RelaunchNotificationController::HandleCurrentStyle() { … }
void RelaunchNotificationController::StartObservingUpgrades() { … }
void RelaunchNotificationController::StopObservingUpgrades() { … }
void RelaunchNotificationController::ShowRelaunchNotification(
UpgradeDetector::UpgradeNotificationAnnoyanceLevel level,
base::Time high_deadline) { … }
void RelaunchNotificationController::CloseRelaunchNotification() { … }
void RelaunchNotificationController::HandleRelaunchRequiredState(
UpgradeDetector::UpgradeNotificationAnnoyanceLevel level,
base::Time high_deadline) { … }
base::Time RelaunchNotificationController::IncreaseRelaunchDeadlineOnShow() { … }
void RelaunchNotificationController::StartReshowTimer() { … }
void RelaunchNotificationController::OnReshowRelaunchRecommended() { … }
void RelaunchNotificationController::NotifyRelaunchRecommended(
bool past_deadline) { … }
void RelaunchNotificationController::DoNotifyRelaunchRecommended(
bool past_deadline) { … }
void RelaunchNotificationController::NotifyRelaunchRequired() { … }
void RelaunchNotificationController::DoNotifyRelaunchRequired(
base::Time relaunch_deadline,
base::OnceCallback<base::Time()> on_visible) { … }
void RelaunchNotificationController::Close() { … }
void RelaunchNotificationController::OnRelaunchDeadlineExpired() { … }