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

Side by Side Diff: components/favicon/core/fallback_icon_service.h

Issue 2883053003: Delete unused chrome://fallback-icon/ handling (Closed)
Patch Set: Merge branch 'master' into searchbox3 Created 3 years, 6 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_CORE_FALLBACK_ICON_SERVICE_H_
6 #define COMPONENTS_FAVICON_CORE_FALLBACK_ICON_SERVICE_H_
7
8 #include <vector>
9
10 #include "base/macros.h"
11 #include "components/keyed_service/core/keyed_service.h"
12
13 class GURL;
14
15 namespace gfx {
16 class Canvas;
17 }
18
19 namespace favicon_base {
20 struct FallbackIconStyle;
21 }
22
23 namespace favicon {
24
25 class FallbackIconClient;
26
27 // A service to provide methods to render fallback favicons.
28 class FallbackIconService : public KeyedService {
29 public:
30 explicit FallbackIconService(FallbackIconClient* fallback_icon_client);
31 ~FallbackIconService() override;
32
33 // Renders a fallback icon synchronously and returns the bitmap. Returns an
34 // empty std::vector on failure. |size| is icon width and height in pixels.
35 std::vector<unsigned char> RenderFallbackIconBitmap(
36 const GURL& icon_url,
37 int size,
38 const favicon_base::FallbackIconStyle& style);
39
40 private:
41 // Renders a fallback icon on |canvas| at position (|x|, |y|). |size| is icon
42 // width and height in pixels.
43 void DrawFallbackIcon(const GURL& icon_url,
44 int size,
45 const favicon_base::FallbackIconStyle& style,
46 gfx::Canvas* canvas);
47
48 FallbackIconClient* fallback_icon_client_;
49
50 DISALLOW_COPY_AND_ASSIGN(FallbackIconService);
51 };
52
53 } // namespace favicon
54
55 #endif // COMPONENTS_FAVICON_CORE_FALLBACK_ICON_SERVICE_H_
OLDNEW
« no previous file with comments | « components/favicon/core/fallback_icon_client.h ('k') | components/favicon/core/fallback_icon_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698