Index: components/favicon_base/fallback_icon_service.h |
diff --git a/components/favicon_base/fallback_icon_service.h b/components/favicon_base/fallback_icon_service.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..17569a13eb470c9f7c71d0be4c27b627e53aaf87 |
--- /dev/null |
+++ b/components/favicon_base/fallback_icon_service.h |
@@ -0,0 +1,48 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_FAVICON_BASE_FAVICON_FALLBACK_ICON_SERVICE_H_ |
+#define COMPONENTS_FAVICON_BASE_FAVICON_FALLBACK_ICON_SERVICE_H_ |
+ |
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
|
+#include <vector> |
pkotwicz
2015/01/21 19:44:15
#include <string>
huangs
2015/01/22 01:13:27
Done.
|
+ |
+#include "base/callback.h" |
+#include "base/macros.h" |
+#include "base/task/cancelable_task_tracker.h" |
+#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.
|
+ |
+class GURL; |
+ |
+namespace gfx { |
+class Canvas; |
+} // 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.
|
+ |
+namespace favicon_base { |
+ |
+struct FallbackIconStyle; |
+ |
+// A service to provide methods to render fallback favicons. |
+class FallbackIconService { |
+ public: |
+ FallbackIconService(); |
+ ~FallbackIconService(); |
+ |
+ // 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
|
+ void DrawFallbackIcon(const GURL& icon_url, int x, int y, int size_in_pixels, |
+ 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.
|
+ |
+ // Renders a fallback icon synchronously and returns the bitmap. Returns an |
+ // empty std::vector on failure. |
+ std::vector<unsigned char> RenderFallbackIconBitmap( |
+ 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.
|
+ |
+ private: |
+ std::vector<std::string> fallback_icon_font_list_;; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FallbackIconService); |
+}; |
+ |
+} // namespace favicon_base |
+ |
+#endif // COMPONENTS_FAVICON_BASE_FAVICON_FALLBACK_ICON_SERVICE_H_ |