Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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 | |
| 5 #ifndef COMPONENTS_FAVICON_BASE_FAVICON_FALLBACK_ICON_SERVICE_H_ | |
| 6 #define COMPONENTS_FAVICON_BASE_FAVICON_FALLBACK_ICON_SERVICE_H_ | |
|
stevenjb
2015/01/29 21:41:08
extra _FAVICON_
huangs
2015/01/29 23:48:27
Done.
| |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 | |
| 13 class GURL; | |
| 14 | |
| 15 namespace gfx { | |
| 16 class Canvas; | |
| 17 } | |
| 18 | |
| 19 namespace favicon_base { | |
| 20 | |
| 21 struct FallbackIconStyle; | |
| 22 | |
| 23 // A service to provide methods to render fallback favicons. | |
| 24 class FallbackIconService { | |
| 25 public: | |
| 26 FallbackIconService(); | |
| 27 ~FallbackIconService(); | |
| 28 | |
| 29 // Renders a fallback icon synchronously and returns the bitmap. Returns an | |
| 30 // empty std::vector on failure. |size| is in pixels. | |
|
stevenjb
2015/01/29 21:41:08
Could you explain what exactly |size| refers to?
huangs
2015/01/29 23:48:27
Done.
| |
| 31 std::vector<unsigned char> RenderFallbackIconBitmap( | |
| 32 const GURL& icon_url, | |
| 33 int size, | |
| 34 const FallbackIconStyle& style); | |
| 35 | |
| 36 private: | |
| 37 // Renders a fallback icon on |canvas| at position (|x|, |y|). |size| is in | |
| 38 // pixels. | |
| 39 void DrawFallbackIcon(const GURL& icon_url, | |
| 40 int size, | |
| 41 const FallbackIconStyle& style, | |
| 42 gfx::Canvas* canvas); | |
| 43 | |
| 44 std::vector<std::string> fallback_icon_font_list_;; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(FallbackIconService); | |
| 47 }; | |
| 48 | |
| 49 } // namespace favicon_base | |
| 50 | |
| 51 #endif // COMPONENTS_FAVICON_BASE_FAVICON_FALLBACK_ICON_SERVICE_H_ | |
| OLD | NEW |