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

Unified Diff: third_party/WebKit/Source/platform/LayoutLocale.h

Issue 2192703002: More LayoutLocale refactor with additional Chinese support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment updated as per drott review Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/LayoutLocale.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/LayoutLocale.h
diff --git a/third_party/WebKit/Source/platform/LayoutLocale.h b/third_party/WebKit/Source/platform/LayoutLocale.h
index 4beb2675802d8a2c664068b5f4fa7266c4a33905..a4bc22c81ec50b56b5ec4829b01d6190c929b0d7 100644
--- a/third_party/WebKit/Source/platform/LayoutLocale.h
+++ b/third_party/WebKit/Source/platform/LayoutLocale.h
@@ -23,26 +23,39 @@ class PLATFORM_EXPORT LayoutLocale : public RefCounted<LayoutLocale> {
public:
static const LayoutLocale* get(const AtomicString& locale);
static const LayoutLocale& getDefault();
+ static const LayoutLocale& getSystem();
static const LayoutLocale& valueOrDefault(const LayoutLocale* locale) { return locale ? *locale : getDefault(); }
+ bool operator==(const LayoutLocale& other) const { return m_string == other.m_string; }
+ bool operator!=(const LayoutLocale& other) const { return m_string != other.m_string; }
+
const AtomicString& localeString() const { return m_string; }
static const AtomicString& localeString(const LayoutLocale* locale) { return locale ? locale->m_string : nullAtom; }
operator const AtomicString&() const { return m_string; }
CString ascii() const { return m_string.ascii(); }
const hb_language_impl_t* harfbuzzLanguage() const { return m_harfbuzzLanguage; }
- const CString& localeForSkFontMgr() const;
+ const char* localeForSkFontMgr() const;
UScriptCode script() const { return m_script; }
+
+ // Disambiguation of the Unified Han Ideographs.
UScriptCode scriptForHan() const;
+ bool hasScriptForHan() const;
+ static const LayoutLocale* localeForHan(const LayoutLocale*);
+ static void setLocaleForHan(const LayoutLocale*);
+ const char* localeForHanForSkFontMgr() const;
Hyphenation* getHyphenation() const;
+ static PassRefPtr<LayoutLocale> createForTesting(const AtomicString&);
static void clearForTesting();
static void setHyphenationForTesting(const AtomicString&, PassRefPtr<Hyphenation>);
private:
explicit LayoutLocale(const AtomicString&);
+ void computeScriptForHan() const;
+
AtomicString m_string;
mutable CString m_stringForSkFontMgr;
mutable RefPtr<Hyphenation> m_hyphenation;
@@ -53,9 +66,13 @@ private:
UScriptCode m_script;
mutable UScriptCode m_scriptForHan;
+ mutable unsigned m_hasScriptForHan : 1;
mutable unsigned m_hyphenationComputed : 1;
static const LayoutLocale* s_default;
+ static const LayoutLocale* s_system;
+ static const LayoutLocale* s_defaultForHan;
+ static bool s_defaultForHanComputed;
};
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/LayoutLocale.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698