Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: components/favicon_base/fallback_icon_service.h

Issue 835903005: [Favicon] Add new fallback icon rendering flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing FallbackIconStyleBuilder; trimming down chrome://fallback-icon syntax. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
7
8 #include <string>
9 #include <vector>
10
11 #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.
12 #include "base/macros.h"
13
14 class GURL;
15
16 namespace gfx {
17 class Canvas;
18 }
19
20 namespace favicon_base {
21
22 class FallbackIconStyle;
23
24 // A service to provide methods to render fallback favicons.
25 class FallbackIconService {
26 public:
27 FallbackIconService();
28 ~FallbackIconService();
29
30 // Renders a fallback icon synchronously and returns the bitmap. Returns an
31 // empty std::vector on failure.
32 std::vector<unsigned char> RenderFallbackIconBitmap(
33 const GURL& icon_url,
34 int size_in_pixels,
35 const FallbackIconStyle& style);
36
37 private:
38 // Renders a fallback icon on |canvas| at position (|x|, |y|).
39 void DrawFallbackIcon(const GURL& icon_url,
40 int x,
41 int y,
42 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
43 const FallbackIconStyle& style,
44 gfx::Canvas* canvas);
45
46 std::vector<std::string> fallback_icon_font_list_;;
47
48 DISALLOW_COPY_AND_ASSIGN(FallbackIconService);
49 };
50
51 } // namespace favicon_base
52
53 #endif // COMPONENTS_FAVICON_BASE_FAVICON_FALLBACK_ICON_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698