chromium/extensions/shell/browser/shell_keep_alive_requester.h

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

#ifndef EXTENSIONS_SHELL_BROWSER_SHELL_KEEP_ALIVE_REQUESTER_H_
#define EXTENSIONS_SHELL_BROWSER_SHELL_KEEP_ALIVE_REQUESTER_H_

#include "apps/app_lifetime_monitor.h"
#include "base/containers/flat_map.h"
#include "base/scoped_observation.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_registry_observer.h"
#include "extensions/common/extension_id.h"

class ScopedKeepAlive;

namespace content {
class BrowserContext;
}  // namespace content

namespace extensions {

// Maintains keep-alives while apps are loading or launching.
//
// Motivation: When an app reloads, its app windows close. If these were the
// last windows open, the application may exit. Keep-alives can be used to
// ensure the application doesn't exit until the app has had a chance to load
// and launch.
class ShellKeepAliveRequester : public ExtensionRegistryObserver,
                                public apps::AppLifetimeMonitor::Observer {};

}  // namespace extensions

#endif  // EXTENSIONS_SHELL_BROWSER_SHELL_KEEP_ALIVE_REQUESTER_H_