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

Unified Diff: chrome/browser/favicon/chrome_fallback_icon_client.cc

Issue 996253002: [Fallback Icons] Refactor FallbackIconService to be a BrowserContext-level singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and reverting small unneeded change. 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: chrome/browser/favicon/chrome_fallback_icon_client.cc
diff --git a/chrome/browser/favicon/chrome_fallback_icon_client.cc b/chrome/browser/favicon/chrome_fallback_icon_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c61295bbbae4eed17ba23845a3a458f317d7eceb
--- /dev/null
+++ b/chrome/browser/favicon/chrome_fallback_icon_client.cc
@@ -0,0 +1,33 @@
+// 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.
+
+#include "chrome/browser/favicon/chrome_fallback_icon_client.h"
+
+#include "chrome/browser/favicon/fallback_icon_service_factory.h"
+#include "grit/platform_locale_settings.h"
+#include "ui/base/l10n/l10n_util.h"
+
+ChromeFallbackIconClient::ChromeFallbackIconClient(Profile* profile)
+ : profile_(profile) {
+#if defined(OS_CHROMEOS)
+ font_list_.push_back("Noto Sans");
+#elif defined(OS_IOS)
+ font_list_.push_back("Helvetica Neue");
+#else
+ font_list_.push_back(l10n_util::GetStringUTF8(IDS_SANS_SERIF_FONT_FAMILY));
+#endif
+}
+
+ChromeFallbackIconClient::~ChromeFallbackIconClient() {
+}
+
+favicon_base::FallbackIconService*
+ChromeFallbackIconClient::GetFallbackIconService() {
+ return FallbackIconServiceFactory::GetForProfile(
sdefresne 2015/03/16 09:11:29 As I'll say later, please remove this method.
huangs 2015/03/16 22:06:10 Done.
+ profile_, ServiceAccessType::EXPLICIT_ACCESS);
+}
+
+const std::vector<std::string>& ChromeFallbackIconClient::GetFontNameList() {
+ return font_list_;
+}

Powered by Google App Engine
This is Rietveld 408576698