#ifndef CHROME_BROWSER_APPS_PLATFORM_APPS_APP_TERMINATION_OBSERVER_H_
#define CHROME_BROWSER_APPS_PLATFORM_APPS_APP_TERMINATION_OBSERVER_H_
#include <optional>
#include "base/callback_list.h"
#include "base/memory/raw_ptr.h"
#include "components/keyed_service/core/keyed_service.h"
namespace content {
class BrowserContext;
}
namespace chrome_apps {
class AppTerminationObserver : public KeyedService {
public:
explicit AppTerminationObserver(content::BrowserContext* browser_context);
AppTerminationObserver(const AppTerminationObserver&) = delete;
AppTerminationObserver& operator=(const AppTerminationObserver&) = delete;
~AppTerminationObserver() override;
void Shutdown() override;
private:
void OnAppTerminating();
raw_ptr<content::BrowserContext> browser_context_;
std::optional<base::CallbackListSubscription> subscription_;
};
}
#endif