| Index: components/favicon_base/fallback_icon_service.h
|
| diff --git a/components/favicon_base/fallback_icon_service.h b/components/favicon_base/fallback_icon_service.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..dc45db4b864e2d830fa3b7b42e76a5cabe52a1aa
|
| --- /dev/null
|
| +++ b/components/favicon_base/fallback_icon_service.h
|
| @@ -0,0 +1,51 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_FAVICON_BASE_FAVICON_FALLBACK_ICON_SERVICE_H_
|
| +#define COMPONENTS_FAVICON_BASE_FAVICON_FALLBACK_ICON_SERVICE_H_
|
| +
|
| +#include <vector>
|
| +
|
| +#include "base/callback.h"
|
| +#include "base/macros.h"
|
| +#include "base/task/cancelable_task_tracker.h"
|
| +#include "components/favicon_base/favicon_callback.h"
|
| +
|
| +class GURL;
|
| +
|
| +namespace gfx {
|
| +class Canvas;
|
| +} // namespace gfx
|
| +
|
| +namespace favicon_base {
|
| +
|
| +struct FallbackIconSpecs;
|
| +
|
| +// A service to provide methods to render fallback favicons.
|
| +class FallbackIconService {
|
| + public:
|
| + FallbackIconService();
|
| + ~FallbackIconService();
|
| +
|
| + // Renders a fallback icon on a given |canvas| at position (|x|, |y|).
|
| + void DrawFallbackIcon(const GURL& icon_url, int x, int y, int size_in_pixels,
|
| + const FallbackIconSpecs& specs, gfx::Canvas* canvas);
|
| +
|
| + // Returns a fallback icon bitmap via callback. Used by FaviconService.
|
| + base::CancelableTaskTracker::TaskId GetFallbackIcon(
|
| + const GURL& icon_url,
|
| + int size_in_pixels,
|
| + const FallbackIconSpecs& specs,
|
| + const FaviconResultsCallback& callback,
|
| + base::CancelableTaskTracker* tracker);
|
| +
|
| + private:
|
| + std::vector<std::string> fallback_icon_font_list_;;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(FallbackIconService);
|
| +};
|
| +
|
| +} // namespace favicon_base
|
| +
|
| +#endif // COMPONENTS_FAVICON_BASE_FAVICON_FALLBACK_ICON_SERVICE_H_
|
|
|