favicon_fetcher_impl.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2020 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 WEBLAYER_BROWSER_FAVICON_FAVICON_FETCHER_IMPL_H_
  5. #define WEBLAYER_BROWSER_FAVICON_FAVICON_FETCHER_IMPL_H_
  6. #include <memory>
  7. #include "base/memory/raw_ptr.h"
  8. #include "weblayer/browser/favicon/favicon_tab_helper.h"
  9. #include "weblayer/public/favicon_fetcher.h"
  10. namespace content {
  11. class WebContents;
  12. }
  13. namespace weblayer {
  14. class FaviconFetcherDelegate;
  15. // FaviconFetcher implementation that largely delegates to FaviconTabHelper
  16. // for the real implementation.
  17. class FaviconFetcherImpl : public FaviconFetcher {
  18. public:
  19. FaviconFetcherImpl(content::WebContents* web_contents,
  20. FaviconFetcherDelegate* delegate);
  21. FaviconFetcherImpl(const FaviconFetcherImpl&) = delete;
  22. FaviconFetcherImpl& operator=(const FaviconFetcherImpl&) = delete;
  23. ~FaviconFetcherImpl() override;
  24. // FaviconFetcher:
  25. gfx::Image GetFavicon() override;
  26. private:
  27. raw_ptr<content::WebContents> web_contents_;
  28. std::unique_ptr<FaviconTabHelper::ObserverSubscription>
  29. observer_subscription_;
  30. };
  31. } // namespace weblayer
  32. #endif // WEBLAYER_BROWSER_FAVICON_FAVICON_FETCHER_IMPL_H_