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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp

Issue 1682103004: Add FontCache::acceptLanguagesChanged() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split Windows logic to a separate CL Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 Google Inc. All rights reserved. 2 * Copyright (c) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 switch (localeToScriptCodeForFontSelection(locale)) { 50 switch (localeToScriptCodeForFontSelection(locale)) {
51 case USCRIPT_SIMPLIFIED_HAN: 51 case USCRIPT_SIMPLIFIED_HAN:
52 return "zh-Hans"; 52 return "zh-Hans";
53 case USCRIPT_TRADITIONAL_HAN: 53 case USCRIPT_TRADITIONAL_HAN:
54 return "zh-Hant"; 54 return "zh-Hant";
55 default: 55 default:
56 return locale.ascii(); 56 return locale.ascii();
57 } 57 }
58 } 58 }
59 59
60 void FontCache::acceptLanguagesChanged(const String&)
tkent 2016/02/12 04:01:19 Style nit: This should be void ...() {} or voi
kojii 2016/02/12 04:33:47 Done, add TODO for planned platforms (win/android)
61 { }
62
60 static AtomicString getFamilyNameForCharacter(UChar32 c, const FontDescription& fontDescription) 63 static AtomicString getFamilyNameForCharacter(UChar32 c, const FontDescription& fontDescription)
61 { 64 {
62 RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault()); 65 RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault());
63 const char* bcp47Locales[2]; 66 const char* bcp47Locales[2];
64 int localeCount = 0; 67 int localeCount = 0;
65 CString defaultLocale = toSkFontMgrLocale(defaultLanguage()); 68 CString defaultLocale = toSkFontMgrLocale(defaultLanguage());
66 bcp47Locales[localeCount++] = defaultLocale.data(); 69 bcp47Locales[localeCount++] = defaultLocale.data();
67 CString fontLocale; 70 CString fontLocale;
68 if (!fontDescription.locale().isEmpty()) { 71 if (!fontDescription.locale().isEmpty()) {
69 fontLocale = toSkFontMgrLocale(fontDescription.locale()); 72 fontLocale = toSkFontMgrLocale(fontDescription.locale());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 break; 106 break;
104 default: 107 default:
105 // For other scripts, use the default generic family mapping logic. 108 // For other scripts, use the default generic family mapping logic.
106 return familyName; 109 return familyName;
107 } 110 }
108 111
109 return getFamilyNameForCharacter(examplerChar, fontDescription); 112 return getFamilyNameForCharacter(examplerChar, fontDescription);
110 } 113 }
111 114
112 } // namespace blink 115 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698