From 4fcbf798173ee586d627a0bfd95c0b83c719b671 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Mon, 3 Aug 2015 15:15:30 +0900 Subject: [PATCH] Bug 1050644 part.1 Add methods to check whether the active TIP is Chinese TIP which deosn't show candidate window in e10s mode r=emk --- widget/windows/TSFTextStore.cpp | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/widget/windows/TSFTextStore.cpp b/widget/windows/TSFTextStore.cpp index aa6b5cfe8d7d..346f76b3b12f 100644 --- a/widget/windows/TSFTextStore.cpp +++ b/widget/windows/TSFTextStore.cpp @@ -807,6 +807,10 @@ public: bool EnsureInitActiveTIPKeyboard(); + /**************************************************************************** + * Japanese TIP + ****************************************************************************/ + // Note that TIP name may depend on the language of the environment. // For example, some TIP may use localized name for its target language // environment but English name for the others. @@ -824,6 +828,28 @@ public: NS_LITERAL_STRING("ATOK ")); } + /**************************************************************************** + * Traditional Chinese TIP + ****************************************************************************/ + + bool IsMSChangJieActive() const + { + return mActiveTIPKeyboardDescription.EqualsLiteral("Microsoft ChangJie") || + mActiveTIPKeyboardDescription.Equals( + NS_LITERAL_STRING("\x5FAE\x8F6F\x4ED3\x9889")) || + mActiveTIPKeyboardDescription.Equals( + NS_LITERAL_STRING("\x5FAE\x8EDF\x5009\x9821")); + } + + bool IsMSQuickQuickActive() const + { + return mActiveTIPKeyboardDescription.EqualsLiteral("Microsoft Quick") || + mActiveTIPKeyboardDescription.Equals( + NS_LITERAL_STRING("\x5FAE\x8F6F\x901F\x6210")) || + mActiveTIPKeyboardDescription.Equals( + NS_LITERAL_STRING("\x5FAE\x8EDF\x901F\x6210")); + } + bool IsFreeChangJieActive() const { // FYI: The TIP name is misspelled... @@ -838,6 +864,28 @@ public: "\x4E2D\x6587 (\x7E41\x9AD4) - \x6613\x9821\x8F38\x5165\x6CD5")); } + /**************************************************************************** + * Simplified Chinese TIP + ****************************************************************************/ + + bool IsMSPinyinActive() const + { + return mActiveTIPKeyboardDescription.EqualsLiteral("Microsoft Pinyin") || + mActiveTIPKeyboardDescription.Equals( + NS_LITERAL_STRING("\x5FAE\x8F6F\x62FC\x97F3")) || + mActiveTIPKeyboardDescription.Equals( + NS_LITERAL_STRING("\x5FAE\x8EDF\x62FC\x97F3")); + } + + bool IsMSWubiActive() const + { + return mActiveTIPKeyboardDescription.EqualsLiteral("Microsoft Wubi") || + mActiveTIPKeyboardDescription.Equals( + NS_LITERAL_STRING("\x5FAE\x8F6F\x4E94\x7B14")) || + mActiveTIPKeyboardDescription.Equals( + NS_LITERAL_STRING("\x5FAE\x8EDF\x4E94\x7B46")); + } + public: // ITfActiveLanguageProfileNotifySink STDMETHODIMP OnActivated(REFCLSID clsid, REFGUID guidProfile, BOOL fActivated);