OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/win/imm32_manager.h" | 5 #include "ui/base/ime/win/imm32_manager.h" |
6 | 6 |
7 #include <msctf.h> | 7 #include <msctf.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 WPARAM lparam, | 371 WPARAM lparam, |
372 int type, | 372 int type, |
373 base::string16* result) { | 373 base::string16* result) { |
374 if (!(lparam & type)) | 374 if (!(lparam & type)) |
375 return false; | 375 return false; |
376 LONG string_size = ::ImmGetCompositionString(imm_context, type, NULL, 0); | 376 LONG string_size = ::ImmGetCompositionString(imm_context, type, NULL, 0); |
377 if (string_size <= 0) | 377 if (string_size <= 0) |
378 return false; | 378 return false; |
379 DCHECK_EQ(0u, string_size % sizeof(wchar_t)); | 379 DCHECK_EQ(0u, string_size % sizeof(wchar_t)); |
380 ::ImmGetCompositionString(imm_context, type, | 380 ::ImmGetCompositionString(imm_context, type, |
381 WriteInto(result, (string_size / sizeof(wchar_t)) + 1), string_size); | 381 base::WriteInto(result, (string_size / sizeof(wchar_t)) + 1), |
| 382 string_size); |
382 return true; | 383 return true; |
383 } | 384 } |
384 | 385 |
385 bool IMM32Manager::GetResult( | 386 bool IMM32Manager::GetResult( |
386 HWND window_handle, LPARAM lparam, base::string16* result) { | 387 HWND window_handle, LPARAM lparam, base::string16* result) { |
387 bool ret = false; | 388 bool ret = false; |
388 HIMC imm_context = ::ImmGetContext(window_handle); | 389 HIMC imm_context = ::ImmGetContext(window_handle); |
389 if (imm_context) { | 390 if (imm_context) { |
390 ret = GetString(imm_context, lparam, GCS_RESULTSTR, result); | 391 ret = GetString(imm_context, lparam, GCS_RESULTSTR, result); |
391 ::ImmReleaseContext(window_handle, imm_context); | 392 ::ImmReleaseContext(window_handle, imm_context); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 | IME_CMODE_KATAKANA | 637 | IME_CMODE_KATAKANA |
637 | IME_CMODE_FULLSHAPE); | 638 | IME_CMODE_FULLSHAPE); |
638 break; | 639 break; |
639 default: | 640 default: |
640 *open = FALSE; | 641 *open = FALSE; |
641 break; | 642 break; |
642 } | 643 } |
643 } | 644 } |
644 | 645 |
645 } // namespace ui | 646 } // namespace ui |
OLD | NEW |