Chromium Code Reviews| 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..fb04e1d492d37e3e894bc43e2d7e27271865132c |
| --- /dev/null |
| +++ b/components/favicon_base/fallback_icon_service.h |
| @@ -0,0 +1,53 @@ |
| +// 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 <string> |
| +#include <vector> |
| + |
| +#include "base/callback.h" |
|
pkotwicz
2015/01/23 16:00:48
Remove the above include because you no longer use
huangs
2015/01/23 19:47:52
Done.
|
| +#include "base/macros.h" |
| + |
| +class GURL; |
| + |
| +namespace gfx { |
| +class Canvas; |
| +} |
| + |
| +namespace favicon_base { |
| + |
| +class FallbackIconStyle; |
| + |
| +// A service to provide methods to render fallback favicons. |
| +class FallbackIconService { |
| + public: |
| + FallbackIconService(); |
| + ~FallbackIconService(); |
| + |
| + // Renders a fallback icon synchronously and returns the bitmap. Returns an |
| + // empty std::vector on failure. |
| + std::vector<unsigned char> RenderFallbackIconBitmap( |
| + const GURL& icon_url, |
| + int size_in_pixels, |
| + const FallbackIconStyle& style); |
| + |
| + private: |
| + // Renders a fallback icon on |canvas| at position (|x|, |y|). |
| + void DrawFallbackIcon(const GURL& icon_url, |
| + int x, |
| + int y, |
| + int size_in_pixels, |
|
pkotwicz
2015/01/23 16:00:48
Nit: |size_in_pixels| -> |size|
huangs
2015/01/23 19:47:52
Done, updated comment to reflect this.
Also updat
|
| + const FallbackIconStyle& style, |
| + gfx::Canvas* canvas); |
| + |
| + 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_ |