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
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 03 Aug 2015 15:15:30 +0900
changeset 287473 b40379bbe7f35429072cce42ffdbce4ad9f21d5a
parent 287472 d1aaf77d3988d82623b4b040c001502a807533fb
child 287474 00e3222ed96f6a2d3c063a38caf1e9e4ba329c03
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemk
bugs1050644
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -802,16 +802,20 @@ public:
 
   static bool IsIMM_IME(HKL aHKL)
   {
      return (::ImmGetIMEFileNameW(aHKL, nullptr, 0) > 0);
   }
 
   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.
   bool IsGoogleJapaneseInputActive() const
   {
     return mActiveTIPKeyboardDescription.Equals(
              NS_LITERAL_STRING("Google \x65E5\x672C\x8A9E\x5165\x529B")) ||
            mActiveTIPKeyboardDescription.EqualsLiteral("Google Japanese Input");
@@ -819,30 +823,74 @@ public:
 
   bool IsATOKActive() const
   {
     // FYI: Name of ATOK includes the release year like "ATOK 2015".
     return StringBeginsWith(mActiveTIPKeyboardDescription,
                             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...
     return mActiveTIPKeyboardDescription.EqualsLiteral("Free CangJie IME 10");
   }
 
   bool IsEasyChangjeiActive() const
   {
     return
       mActiveTIPKeyboardDescription.Equals(
         NS_LITERAL_STRING(
           "\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);
 
 public: // ITfInputProcessorProfileActivationSink
   STDMETHODIMP OnActivated(DWORD, LANGID, REFCLSID, REFGUID, REFGUID,
                            HKL, DWORD);