| 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" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/win/scoped_comptr.h" | 14 #include "base/win/scoped_comptr.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
| 16 #include "ui/base/ime/composition_text.h" | 16 #include "ui/base/ime/composition_text.h" |
| 17 | 17 |
| 18 // "imm32.lib" is required by IMM32 APIs used in this file. | 18 // "imm32.lib" is required by IMM32 APIs used in this file. |
| 19 // NOTE(hbono): To comply with a comment from Darin, I have added | 19 // NOTE(hbono): To comply with a comment from Darin, I have added |
| 20 // this #pragma directive instead of adding "imm32.lib" to a project file. | 20 // this #pragma directive instead of adding "imm32.lib" to a project file. |
| 21 #pragma comment(lib, "imm32.lib") | 21 #pragma comment(lib, "imm32.lib") |
| 22 | 22 |
| 23 // Following code requires wchar_t to be same as char16. It should always be | 23 // Following code requires wchar_t to be same as char16. It should always be |
| 24 // true on Windows. | 24 // true on Windows. |
| 25 COMPILE_ASSERT(sizeof(wchar_t) == sizeof(base::char16), wchar_t__char16_diff); | 25 static_assert(sizeof(wchar_t) == sizeof(base::char16), |
| 26 "wchar_t should be the same size as char16"); |
| 26 | 27 |
| 27 /////////////////////////////////////////////////////////////////////////////// | 28 /////////////////////////////////////////////////////////////////////////////// |
| 28 // IMM32Manager | 29 // IMM32Manager |
| 29 | 30 |
| 30 namespace { | 31 namespace { |
| 31 | 32 |
| 32 // Determines whether or not the given attribute represents a target | 33 // Determines whether or not the given attribute represents a target |
| 33 // (a.k.a. a selection). | 34 // (a.k.a. a selection). |
| 34 bool IsTargetAttribute(char attribute) { | 35 bool IsTargetAttribute(char attribute) { |
| 35 return (attribute == ATTR_TARGET_CONVERTED || | 36 return (attribute == ATTR_TARGET_CONVERTED || |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | IME_CMODE_KATAKANA | 634 | IME_CMODE_KATAKANA |
| 634 | IME_CMODE_FULLSHAPE); | 635 | IME_CMODE_FULLSHAPE); |
| 635 break; | 636 break; |
| 636 default: | 637 default: |
| 637 *open = FALSE; | 638 *open = FALSE; |
| 638 break; | 639 break; |
| 639 } | 640 } |
| 640 } | 641 } |
| 641 | 642 |
| 642 } // namespace ui | 643 } // namespace ui |
| OLD | NEW |