| 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/win/tsf_input_scope.h" | 5 #include "ui/base/ime/win/tsf_input_scope.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 UINT num_input_scopes, | 109 UINT num_input_scopes, |
| 110 WCHAR**, /* unused */ | 110 WCHAR**, /* unused */ |
| 111 UINT, /* unused */ | 111 UINT, /* unused */ |
| 112 WCHAR*, /* unused */ | 112 WCHAR*, /* unused */ |
| 113 WCHAR* /* unused */); | 113 WCHAR* /* unused */); |
| 114 | 114 |
| 115 SetInputScopesFunc g_set_input_scopes = NULL; | 115 SetInputScopesFunc g_set_input_scopes = NULL; |
| 116 bool g_get_proc_done = false; | 116 bool g_get_proc_done = false; |
| 117 | 117 |
| 118 SetInputScopesFunc GetSetInputScopes() { | 118 SetInputScopesFunc GetSetInputScopes() { |
| 119 DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); | 119 DCHECK(base::MessageLoopForUI::IsCurrent()); |
| 120 // Thread safety is not required because this function is under UI thread. | 120 // Thread safety is not required because this function is under UI thread. |
| 121 if (!g_get_proc_done) { | 121 if (!g_get_proc_done) { |
| 122 g_get_proc_done = true; | 122 g_get_proc_done = true; |
| 123 | 123 |
| 124 // For stability reasons, we do not support Windows XP. | 124 // For stability reasons, we do not support Windows XP. |
| 125 if (base::win::GetVersion() < base::win::VERSION_VISTA) | 125 if (base::win::GetVersion() < base::win::VERSION_VISTA) |
| 126 return NULL; | 126 return NULL; |
| 127 | 127 |
| 128 HMODULE module = NULL; | 128 HMODULE module = NULL; |
| 129 if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_PIN, L"msctf.dll", | 129 if (!GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_PIN, L"msctf.dll", |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 return; | 208 return; |
| 209 | 209 |
| 210 std::vector<InputScope> input_scopes = GetInputScopes(text_input_type, | 210 std::vector<InputScope> input_scopes = GetInputScopes(text_input_type, |
| 211 text_input_mode); | 211 text_input_mode); |
| 212 set_input_scopes(window_handle, &input_scopes[0], input_scopes.size(), NULL, | 212 set_input_scopes(window_handle, &input_scopes[0], input_scopes.size(), NULL, |
| 213 0, NULL, NULL); | 213 0, NULL, NULL); |
| 214 } | 214 } |
| 215 | 215 |
| 216 } // namespace tsf_inputscope | 216 } // namespace tsf_inputscope |
| 217 } // namespace ui | 217 } // namespace ui |
| OLD | NEW |