Use ITfThread::AssociateFocus to corp with TSF runtime
Use ITfThread::AssociateFocus to corp with TSF runtime

It turned out that TSF runtime monitors some Win32 messages
such as WM_ACTIVATE to change the focused document manager.
This is problematic especially when
TSFBridge::SetFocusedClient is called first then the target
window receives WM_ACTIVATE. This actually occurs in Aura
environment, which uses WM_NCACTIVATE as a trigger to
restore text input focus.

  1. Begin WM_NCACTIVATE handler
  2.   Aura starts restoring logical text input focus
  3.   TSFBridge::SetFocusedClient is called
  4.   TSFBridge calls ITfThreadMgr::SetFocus
  5.   An IME receives OnSetFocus event
  6. End WM_NCACTIVATE handler
  7. Begin WM_ACTIVATE handler
  8.   TSF runtime snoops WM_ACTIVATE event
  9.   An IME receives OnSetFocus event
 10. End WM_ACTIVATE handler

As far as I've investigated, there seems to be no way to
disable step 7-10 above. So this CL introduces a workaround
to corp with this behavior.

With this CL, TSFBridge starts to use not only
ITfThread::SetFocus but also ITfThread::AssociateFocus
so that TSF runtime can know which document manager is
associated with a specific HWND. With this change,
TSF runtime sets the expected document manager at step 9.

BUG=287620
TEST=manually done with --enable-text-services-framework on Win-Aura.

Review URL: https://chromiumcodereview.appspot.com/23890024

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@223021 0039d316-1c4b-4281-b951-d872f2087c98

chuan9/chromium-crosswalk,Just-D/chromium-1,littlstar/chromium.src,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,axinging/chromium-crosswalk,Just-D/chromium-1,Chilledheart/chromium,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,dednal/chromium.src,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,mogoweb/chromium-crosswalk,littlstar/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,bright-sparks/chromium-spacewalk,Chilledheart/chromium,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,Chilledheart/chromium,fujunwei/chromium-crosswalk,patrickm/chromium.src,littlstar/chromium.src,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,anirudhSK/chromium,ondra-novak/chromium.src,dushu1203/chromium.src,markYoungH/chromium.src,littlstar/chromium.src,markYoungH/chromium.src,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,patrickm/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,dednal/chromium.src,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,mogoweb/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,Just-D/chromium-1,Jonekee/chromium.src,jaruba/chromium.src,Fireblend/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,ltilve/chromium,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,axinging/chromium-crosswalk,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,ondra-novak/chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,hgl888/chromium-crosswalk,M4sse/chromium.src,ondra-novak/chromium.src,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,Chilledheart/chromium,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,M4sse/chromium.src,dednal/chromium.src,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,Chilledheart/chromium,Just-D/chromium-1,mogoweb/chromium-crosswalk,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,patrickm/chromium.src,ondra-novak/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,markYoungH/chromium.src,fujunwei/chromium-crosswalk,patrickm/chromium.src,Jonekee/chromium.src,patrickm/chromium.src,jaruba/chromium.src,patrickm/chromium.src,Just-D/chromium-1,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,dednal/chromium.src,Jonekee/chromium.src,dushu1203/chromium.src,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,dednal/chromium.src,ChromiumWebApps/chromium,jaruba/chromium.src,ChromiumWebApps/chromium,patrickm/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,jaruba/chromium.src,ltilve/chromium,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ltilve/chromium,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,Just-D/chromium-1,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,ltilve/chromium,littlstar/chromium.src,anirudhSK/chromium,M4sse/chromium.src,fujunwei/chromium-crosswalk,anirudhSK/chromium,fujunwei/chromium-crosswalk,ondra-novak/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,chuan9/chromium-crosswalk,Chilledheart/chromium,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,patrickm/chromium.src,littlstar/chromium.src,markYoungH/chromium.src,Just-D/chromium-1,ltilve/chromium,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,chuan9/chromium-crosswalk,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,littlstar/chromium.src,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,M4sse/chromium.src,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,ltilve/chromium,TheTypoMaster/chromium-crosswalk,littlstar/chromium.src,jaruba/chromium.src,jaruba/chromium.src,Just-D/chromium-1,Just-D/chromium-1,bright-sparks/chromium-spacewalk,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,dednal/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,dednal/chromium.src,mogoweb/chromium-crosswalk,Jonekee/chromium.src,jaruba/chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,anirudhSK/chromium,jaruba/chromium.src,ChromiumWebApps/chromium,ltilve/chromium,ChromiumWebApps/chromium,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,anirudhSK/chromium,ltilve/chromium,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src