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

Unified Diff: components/favicon/core/fallback_icon_service.cc

Issue 1032683002: [Icons NTP] Refactoring: Moving FallbackIconService to components\favicon\core (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Putting back +third_party/skia/include for favicon_base DEPS. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: components/favicon/core/fallback_icon_service.cc
diff --git a/components/favicon_base/fallback_icon_service.cc b/components/favicon/core/fallback_icon_service.cc
similarity index 87%
rename from components/favicon_base/fallback_icon_service.cc
rename to components/favicon/core/fallback_icon_service.cc
index adce72e105f6a1fce671c62fb27dabcecfb0ef87..e17481858cbbc6cfe3ebc74c1b5a69d44b48aaae 100644
--- a/components/favicon_base/fallback_icon_service.cc
+++ b/components/favicon/core/fallback_icon_service.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/favicon_base/fallback_icon_service.h"
+#include "components/favicon/core/fallback_icon_service.h"
#include <algorithm>
@@ -18,8 +18,6 @@
#include "ui/gfx/geometry/size.h"
#include "url/gurl.h"
-namespace favicon_base {
-
namespace {
// Arbitrary maximum icon size, can be reasonably increased if needed.
@@ -48,7 +46,7 @@ FallbackIconService::~FallbackIconService() {
std::vector<unsigned char> FallbackIconService::RenderFallbackIconBitmap(
const GURL& icon_url,
int size,
- const FallbackIconStyle& style) {
+ const favicon_base::FallbackIconStyle& style) {
int size_to_use = std::min(kMaxFallbackFaviconSize, size);
gfx::Canvas canvas(gfx::Size(size_to_use, size_to_use), 1.0f, false);
DrawFallbackIcon(icon_url, size_to_use, style, &canvas);
@@ -61,10 +59,11 @@ std::vector<unsigned char> FallbackIconService::RenderFallbackIconBitmap(
return bitmap_data;
}
-void FallbackIconService::DrawFallbackIcon(const GURL& icon_url,
- int size,
- const FallbackIconStyle& style,
- gfx::Canvas* canvas) {
+void FallbackIconService::DrawFallbackIcon(
+ const GURL& icon_url,
+ int size,
+ const favicon_base::FallbackIconStyle& style,
+ gfx::Canvas* canvas) {
const int kOffsetX = 0;
const int kOffsetY = 0;
SkPaint paint;
@@ -93,5 +92,3 @@ void FallbackIconService::DrawFallbackIcon(const GURL& icon_url,
gfx::Rect(kOffsetX, kOffsetY, size, size),
gfx::Canvas::TEXT_ALIGN_CENTER);
}
-
-} // namespace favicon_base

Powered by Google App Engine
This is Rietveld 408576698