chromium/chrome/browser/apps/app_service/app_registry_cache_waiter.h

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

#ifndef CHROME_BROWSER_APPS_APP_SERVICE_APP_REGISTRY_CACHE_WAITER_H_
#define CHROME_BROWSER_APPS_APP_SERVICE_APP_REGISTRY_CACHE_WAITER_H_

#include <string>

#include "base/location.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "components/services/app_service/public/cpp/app_registry_cache.h"
#include "components/services/app_service/public/cpp/app_types.h"
#include "components/services/app_service/public/cpp/app_update.h"
#include "url/gurl.h"

class Profile;

namespace apps {

// Waits for a given AppType to be initialized in App Service.
class AppTypeInitializationWaiter : public apps::AppRegistryCache::Observer {};

// Waits for an app in the App Registry Cache to match an arbitrary condition.
// See below for specializations for common conditions.
class AppUpdateWaiter : public apps::AppRegistryCache::Observer {};

// Waits for the app's Readiness in the App Service app cache to match the
// expected value.
class AppReadinessWaiter : public AppUpdateWaiter {};

// Waits for the web app's scope in the App Service app cache to match the
// expected |scope|.
class WebAppScopeWaiter : public AppUpdateWaiter {};

// Waits for the app's window mode in the App Service app cache to match the
// expected |window_mode|.
class AppWindowModeWaiter : public AppUpdateWaiter {};

}  // namespace apps

#endif  // CHROME_BROWSER_APPS_APP_SERVICE_APP_REGISTRY_CACHE_WAITER_H_