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

Side by Side Diff: ui/base/ime/input_method_tsf.cc

Issue 23615013: Completes crrev.com/23478020 and makes sure of detachment from IME. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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 unified diff | Download patch
« no previous file with comments | « ui/base/ime/input_method_tsf.h ('k') | ui/base/ime/win/tsf_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/ime/input_method_tsf.h" 5 #include "ui/base/ime/input_method_tsf.h"
6 6
7 #include "ui/base/ime/text_input_client.h" 7 #include "ui/base/ime/text_input_client.h"
8 #include "ui/base/ime/win/tsf_bridge.h" 8 #include "ui/base/ime/win/tsf_bridge.h"
9 #include "ui/base/ime/win/tsf_event_router.h" 9 #include "ui/base/ime/win/tsf_event_router.h"
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 } else { 123 } else {
124 // SetFocusedTextInputClient(NULL) must be interpreted as 124 // SetFocusedTextInputClient(NULL) must be interpreted as
125 // "Remove the attached client". 125 // "Remove the attached client".
126 ui::TSFBridge::GetInstance()->RemoveFocusedClient( 126 ui::TSFBridge::GetInstance()->RemoveFocusedClient(
127 ui::TSFBridge::GetInstance()->GetFocusedTextInputClient()); 127 ui::TSFBridge::GetInstance()->GetFocusedTextInputClient());
128 } 128 }
129 } 129 }
130 InputMethodWin::SetFocusedTextInputClient(client); 130 InputMethodWin::SetFocusedTextInputClient(client);
131 } 131 }
132 132
133 void InputMethodTSF::DetachTextInputClient(TextInputClient* client) {
134 InputMethodWin::DetachTextInputClient(client);
135 ui::TSFBridge::GetInstance()->RemoveFocusedClient(client);
136 }
137
133 bool InputMethodTSF::IsCandidatePopupOpen() const { 138 bool InputMethodTSF::IsCandidatePopupOpen() const {
134 return tsf_event_observer_->IsCandidatePopupOpen(); 139 return tsf_event_observer_->IsCandidatePopupOpen();
135 } 140 }
136 141
137 void InputMethodTSF::OnWillChangeFocusedClient(TextInputClient* focused_before, 142 void InputMethodTSF::OnWillChangeFocusedClient(TextInputClient* focused_before,
138 TextInputClient* focused) { 143 TextInputClient* focused) {
139 if (IsWindowFocused(focused_before)) { 144 if (IsWindowFocused(focused_before)) {
140 ConfirmCompositionText(); 145 ConfirmCompositionText();
141 ui::TSFBridge::GetInstance()->RemoveFocusedClient(focused_before); 146 ui::TSFBridge::GetInstance()->RemoveFocusedClient(focused_before);
142 } 147 }
(...skipping 20 matching lines...) Expand all
163 if (!IsTextInputTypeNone()) 168 if (!IsTextInputTypeNone())
164 ui::TSFBridge::GetInstance()->ConfirmComposition(); 169 ui::TSFBridge::GetInstance()->ConfirmComposition();
165 } 170 }
166 171
167 bool InputMethodTSF::IsWindowFocused(const TextInputClient* client) const { 172 bool InputMethodTSF::IsWindowFocused(const TextInputClient* client) const {
168 HWND attached_window_handle = GetAttachedWindowHandle(client); 173 HWND attached_window_handle = GetAttachedWindowHandle(client);
169 return attached_window_handle && GetFocus() == attached_window_handle; 174 return attached_window_handle && GetFocus() == attached_window_handle;
170 } 175 }
171 176
172 } // namespace ui 177 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/input_method_tsf.h ('k') | ui/base/ime/win/tsf_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698