ash_web_view_factory.h 965 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2019 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 ASH_PUBLIC_CPP_ASH_WEB_VIEW_FACTORY_H_
  5. #define ASH_PUBLIC_CPP_ASH_WEB_VIEW_FACTORY_H_
  6. #include <memory>
  7. #include "ash/public/cpp/ash_public_export.h"
  8. #include "ash/public/cpp/ash_web_view.h"
  9. namespace ash {
  10. // A factory implemented in Browser which is responsible for creating instances
  11. // of AshWebView to work around dependency restrictions in Ash.
  12. class ASH_PUBLIC_EXPORT AshWebViewFactory {
  13. public:
  14. // Returns the singleton factory instance.
  15. static AshWebViewFactory* Get();
  16. // Creates a new AshWebView instance with the given |params|.
  17. virtual std::unique_ptr<AshWebView> Create(
  18. const AshWebView::InitParams& params) = 0;
  19. protected:
  20. AshWebViewFactory();
  21. virtual ~AshWebViewFactory();
  22. };
  23. } // namespace ash
  24. #endif // ASH_PUBLIC_CPP_ASH_WEB_VIEW_FACTORY_H_