Completes crrev.com/23478020 and makes sure of detachment from IME.

http://crrev.com/23478020 was incomplete and this CL implements the rest.

BUG=280219
TEST=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221748 0039d316-1c4b-4281-b951-d872f2087c98
parent c56df86e
......@@ -130,6 +130,11 @@ void InputMethodTSF::SetFocusedTextInputClient(TextInputClient* client) {
InputMethodWin::SetFocusedTextInputClient(client);
}
void InputMethodTSF::DetachTextInputClient(TextInputClient* client) {
InputMethodWin::DetachTextInputClient(client);
ui::TSFBridge::GetInstance()->RemoveFocusedClient(client);
}
bool InputMethodTSF::IsCandidatePopupOpen() const {
return tsf_event_observer_->IsCandidatePopupOpen();
}
......
......@@ -32,6 +32,7 @@ class UI_EXPORT InputMethodTSF : public InputMethodWin {
virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE;
virtual void CancelComposition(const TextInputClient* client) OVERRIDE;
virtual void SetFocusedTextInputClient(TextInputClient* client) OVERRIDE;
virtual void DetachTextInputClient(TextInputClient* client) OVERRIDE;
virtual bool IsCandidatePopupOpen() const OVERRIDE;
// Overridden from InputMethodBase:
......
......@@ -262,7 +262,7 @@ void TSFBridgeDelegate::RemoveFocusedClient(TextInputClient* client) {
return;
client_ = NULL;
for (TSFDocumentMap::iterator it = tsf_document_map_.begin();
it != tsf_document_map_.end(); ++it) {
it != tsf_document_map_.end(); ++it) {
if (it->second.text_store.get() == NULL)
continue;
it->second.text_store->SetFocusedTextInputClient(NULL, NULL);
......
......@@ -29,8 +29,7 @@ InputMethodBridge::~InputMethodBridge() {
// this and go into |widget_|. NULL out |widget_| so we don't attempt to use
// it.
DetachFromWidget();
if (host_->GetTextInputClient() == this)
host_->SetFocusedTextInputClient(NULL);
host_->DetachTextInputClient(this);
}
void InputMethodBridge::OnFocus() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment