blob: 10d3b24097bd809ad33b9ac8084c153b3054682a [file] [log] [blame]
// Copyright 2016 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.
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
#include "chrome/browser/profiles/profile.h"
#include "third_party/cros_system_api/dbus/update_engine/dbus-constants.h"
namespace chromeos {
// EolNotification is created when user logs in. It is
// used to check current EndOfLife Status of the device,
// and show notification accordingly.
class EolNotification final {
// Returns true if the eol notification needs to be displayed.
static bool ShouldShowEolNotification();
explicit EolNotification(Profile* profile);
// Check Eol status from update engine.
void CheckEolStatus();
// Callback invoked when |GetEolStatus()| has finished.
void OnEolStatus(update_engine::EndOfLifeStatus status);
// Create or updates the notfication.
void Update();
// Profile which is associated with the EndOfLife notification.
Profile* const profile_;
// Device EndOfLife status.
update_engine::EndOfLifeStatus status_;
// Factory of callbacks.
base::WeakPtrFactory<EolNotification> weak_factory_;
} // namespace chromeos