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_ | |
7 | |
pkotwicz
2015/01/21 19:44:15
Nit: Given that eventually you want to make use of
huangs
2015/01/22 01:13:27
Leaving the file here. However, FallbackIconServi
| |
8 #include <vector> | |
pkotwicz
2015/01/21 19:44:15
#include <string>
huangs
2015/01/22 01:13:27
Done.
| |
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" | |
pkotwicz
2015/01/21 19:44:15
Remove cancelable_task_tracker.h and favicon_callb
huangs
2015/01/22 01:13:27
Done.
| |
14 | |
15 class GURL; | |
16 | |
17 namespace gfx { | |
18 class Canvas; | |
19 } // namespace gfx | |
pkotwicz
2015/01/21 19:44:15
Nit: Remove namespace comment. We do not do namesp
huangs
2015/01/22 01:13:28
Done.
| |
20 | |
21 namespace favicon_base { | |
22 | |
23 struct FallbackIconStyle; | |
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|). | |
pkotwicz
2015/01/21 19:44:15
Nits:
- Can you make this method private?
- "a giv
huangs
2015/01/22 01:13:28
bookmark_app_helper.cc has the comment
// Overlay
| |
32 void DrawFallbackIcon(const GURL& icon_url, int x, int y, int size_in_pixels, | |
33 const FallbackIconStyle& style, gfx::Canvas* canvas); | |
pkotwicz
2015/01/21 19:44:15
Style: Each parameter on its own line
huangs
2015/01/22 01:13:28
I thought this is okay if things fit on 2 lines.
| |
34 | |
35 // Renders a fallback icon synchronously and returns the bitmap. Returns an | |
36 // empty std::vector on failure. | |
37 std::vector<unsigned char> RenderFallbackIconBitmap( | |
38 const GURL& icon_url, int size_in_pixels, const FallbackIconStyle& style); | |
pkotwicz
2015/01/21 19:44:15
Style: Each parameter on its own line
huangs
2015/01/22 01:13:28
Done.
| |
39 | |
40 private: | |
41 std::vector<std::string> fallback_icon_font_list_;; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(FallbackIconService); | |
44 }; | |
45 | |
46 } // namespace favicon_base | |
47 | |
48 #endif // COMPONENTS_FAVICON_BASE_FAVICON_FALLBACK_ICON_SERVICE_H_ | |
OLD | NEW |