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

Unified Diff: chrome/browser/ui/webui/options/font_settings_utils.cc

Issue 2441343003: Allow the default generic font family settings to find the first available font (Closed)
Patch Set: msw review Created 4 years, 2 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/ui/webui/options/font_settings_utils.cc
diff --git a/chrome/browser/ui/webui/options/font_settings_utils.cc b/chrome/browser/ui/webui/options/font_settings_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..516b138c93e4daf644f4cdf5057588b792363a3f
--- /dev/null
+++ b/chrome/browser/ui/webui/options/font_settings_utils.cc
@@ -0,0 +1,25 @@
+// Copyright (c) 2016 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/ui/webui/options/font_settings_utils.h"
+
+#include "ui/gfx/font_list.h"
+
+namespace options {
+
+std::string FontSettingsUtilities::ResolveFontList(
+ const std::string& font_name_or_list) {
+ if (!font_name_or_list.empty() && font_name_or_list[0] == ',')
+ return gfx::FontList::FirstAvailableOrFirst(font_name_or_list);
+ return font_name_or_list;
+}
+
+#if !defined(OS_WIN)
+std::string FontSettingsUtilities::MaybeGetLocalizedFontName(
+ const std::string& font_name_or_list) {
+ return ResolveFontList(font_name_or_list);
+}
+#endif
+
+} // namespace options
« no previous file with comments | « chrome/browser/ui/webui/options/font_settings_utils.h ('k') | chrome/browser/ui/webui/options/font_settings_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698