process_util.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef EXTENSIONS_BROWSER_PROCESS_UTIL_H_
  5. #define EXTENSIONS_BROWSER_PROCESS_UTIL_H_
  6. namespace content {
  7. class BrowserContext;
  8. }
  9. namespace extensions {
  10. class Extension;
  11. namespace process_util {
  12. enum class PersistentBackgroundPageState {
  13. // The extension doesn't have a persistent background page.
  14. kInvalid,
  15. // The background page isn't ready yet.
  16. kNotReady,
  17. // The background page is "ready"; in practice, this corresponds to the
  18. // document element being available in the background page's ExtensionHost.
  19. kReady,
  20. };
  21. // Returns the state of the persistent background page (if any) for the given
  22. // `extension`.
  23. PersistentBackgroundPageState GetPersistentBackgroundPageState(
  24. const Extension& extension,
  25. content::BrowserContext* browser_context);
  26. } // namespace process_util
  27. } // namespace extensions
  28. #endif // EXTENSIONS_BROWSER_PROCESS_UTIL_H_