| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_win.h" | 5 #include "ui/base/ime/input_method_win.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/profiler/scoped_tracker.h" | 8 #include "base/profiler/scoped_tracker.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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 LRESULT InputMethodWin::OnImeNotify(UINT message, | 359 LRESULT InputMethodWin::OnImeNotify(UINT message, |
| 360 WPARAM wparam, | 360 WPARAM wparam, |
| 361 LPARAM lparam, | 361 LPARAM lparam, |
| 362 BOOL* handled) { | 362 BOOL* handled) { |
| 363 // TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed. | 363 // TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed. |
| 364 tracked_objects::ScopedTracker tracking_profile( | 364 tracked_objects::ScopedTracker tracking_profile( |
| 365 FROM_HERE_WITH_EXPLICIT_FUNCTION("440919 InputMethodWin::OnImeNotify")); | 365 FROM_HERE_WITH_EXPLICIT_FUNCTION("440919 InputMethodWin::OnImeNotify")); |
| 366 | 366 |
| 367 *handled = FALSE; | 367 *handled = FALSE; |
| 368 | 368 |
| 369 bool previous_state = is_candidate_popup_open_; | |
| 370 | |
| 371 // Update |is_candidate_popup_open_|, whether a candidate window is open. | 369 // Update |is_candidate_popup_open_|, whether a candidate window is open. |
| 372 switch (wparam) { | 370 switch (wparam) { |
| 373 case IMN_OPENCANDIDATE: | 371 case IMN_OPENCANDIDATE: |
| 374 is_candidate_popup_open_ = true; | 372 is_candidate_popup_open_ = true; |
| 375 if (!previous_state) | |
| 376 OnCandidateWindowShown(); | |
| 377 break; | 373 break; |
| 378 case IMN_CLOSECANDIDATE: | 374 case IMN_CLOSECANDIDATE: |
| 379 is_candidate_popup_open_ = false; | 375 is_candidate_popup_open_ = false; |
| 380 if (previous_state) | |
| 381 OnCandidateWindowHidden(); | |
| 382 break; | |
| 383 case IMN_CHANGECANDIDATE: | |
| 384 // TODO(kochi): The IME API expects this event to notify window size change, | |
| 385 // while this may fire more often without window resize. There is no generic | |
| 386 // way to get bounds of candidate window. | |
| 387 OnCandidateWindowUpdated(); | |
| 388 break; | 376 break; |
| 389 } | 377 } |
| 390 | 378 |
| 391 return 0; | 379 return 0; |
| 392 } | 380 } |
| 393 | 381 |
| 394 LRESULT InputMethodWin::OnImeRequest(UINT message, | 382 LRESULT InputMethodWin::OnImeRequest(UINT message, |
| 395 WPARAM wparam, | 383 WPARAM wparam, |
| 396 LPARAM lparam, | 384 LPARAM lparam, |
| 397 BOOL* handled) { | 385 BOOL* handled) { |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 enabled_ = true; | 617 enabled_ = true; |
| 630 break; | 618 break; |
| 631 } | 619 } |
| 632 | 620 |
| 633 imm32_manager_.SetTextInputMode(window_handle, text_input_mode); | 621 imm32_manager_.SetTextInputMode(window_handle, text_input_mode); |
| 634 tsf_inputscope::SetInputScopeForTsfUnawareWindow( | 622 tsf_inputscope::SetInputScopeForTsfUnawareWindow( |
| 635 window_handle, text_input_type, text_input_mode); | 623 window_handle, text_input_type, text_input_mode); |
| 636 } | 624 } |
| 637 | 625 |
| 638 } // namespace ui | 626 } // namespace ui |
| OLD | NEW |