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

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: Refactor by extracting FallbackIconSpecsBuilder. 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 <vector>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/task/cancelable_task_tracker.h"
13 #include "components/favicon_base/favicon_callback.h"
14
15 class GURL;
16
17 namespace gfx {
18 class Canvas;
19 } // namespace gfx
20
21 namespace favicon_base {
22
23 struct FallbackIconSpecs;
24
25 // A service to provide methods to render fallback favicons.
26 class FallbackIconService {
27 public:
28 FallbackIconService();
29 ~FallbackIconService();
30
31 // Renders a fallback icon on a given |canvas| at position (|x|, |y|).
32 void DrawFallbackIcon(const GURL& icon_url, int x, int y, int size_in_pixels,
33 const FallbackIconSpecs& specs, gfx::Canvas* canvas);
34
35 // Returns a fallback icon bitmap via callback. Used by FaviconService.
36 base::CancelableTaskTracker::TaskId GetFallbackIcon(
37 const GURL& icon_url,
38 int size_in_pixels,
39 const FallbackIconSpecs& specs,
40 const FaviconResultsCallback& callback,
41 base::CancelableTaskTracker* tracker);
42
43 private:
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698