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

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

Issue 80583002: [FYI] All-in-one OnCandidateWindow{Show,Update,Hide} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/ime/input_method_base_unittest.cc ('k') | ui/base/ime/input_method_tsf.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_imm32.h" 5 #include "ui/base/ime/input_method_imm32.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "ui/base/ime/composition_text.h" 8 #include "ui/base/ime/composition_text.h"
9 #include "ui/base/ime/text_input_client.h" 9 #include "ui/base/ime/text_input_client.h"
10 #include "ui/base/ime/win/tsf_input_scope.h" 10 #include "ui/base/ime/win/tsf_input_scope.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 imm32_manager_.DestroyImeWindow(window_handle); 228 imm32_manager_.DestroyImeWindow(window_handle);
229 return 0; 229 return 0;
230 } 230 }
231 231
232 LRESULT InputMethodIMM32::OnImeNotify(UINT message, 232 LRESULT InputMethodIMM32::OnImeNotify(UINT message,
233 WPARAM wparam, 233 WPARAM wparam,
234 LPARAM lparam, 234 LPARAM lparam,
235 BOOL* handled) { 235 BOOL* handled) {
236 *handled = FALSE; 236 *handled = FALSE;
237 237
238 bool previous_state = is_candidate_popup_open_;
239
238 // Update |is_candidate_popup_open_|, whether a candidate window is open. 240 // Update |is_candidate_popup_open_|, whether a candidate window is open.
239 switch (wparam) { 241 switch (wparam) {
240 case IMN_OPENCANDIDATE: 242 case IMN_OPENCANDIDATE:
241 is_candidate_popup_open_ = true; 243 is_candidate_popup_open_ = true;
244 if (!previous_state)
245 OnCandidateWindowShown();
242 break; 246 break;
243 case IMN_CLOSECANDIDATE: 247 case IMN_CLOSECANDIDATE:
244 is_candidate_popup_open_ = false; 248 is_candidate_popup_open_ = false;
249 if (previous_state)
250 OnCandidateWindowHidden();
251 break;
252 case IMN_CHANGECANDIDATE:
253 // TODO(kochi): The IME API expects this event to notify window size change,
254 // while this may fire more often without window resize. There is no generic
255 // way to get bounds of candidate window.
256 OnCandidateWindowUpdated();
245 break; 257 break;
246 } 258 }
247 259
248 return 0; 260 return 0;
249 } 261 }
250 262
251 void InputMethodIMM32::ConfirmCompositionText() { 263 void InputMethodIMM32::ConfirmCompositionText() {
252 if (composing_window_handle_) 264 if (composing_window_handle_)
253 imm32_manager_.CleanupComposition(composing_window_handle_); 265 imm32_manager_.CleanupComposition(composing_window_handle_);
254 266
(...skipping 23 matching lines...) Expand all
278 enabled_ = true; 290 enabled_ = true;
279 break; 291 break;
280 } 292 }
281 293
282 imm32_manager_.SetTextInputMode(window_handle, text_input_mode); 294 imm32_manager_.SetTextInputMode(window_handle, text_input_mode);
283 tsf_inputscope::SetInputScopeForTsfUnawareWindow( 295 tsf_inputscope::SetInputScopeForTsfUnawareWindow(
284 window_handle, text_input_type, text_input_mode); 296 window_handle, text_input_type, text_input_mode);
285 } 297 }
286 298
287 } // namespace ui 299 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/input_method_base_unittest.cc ('k') | ui/base/ime/input_method_tsf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698