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

Side by Side Diff: ui/base/ime/win/imm32_manager.cc

Issue 2445253002: Fix the issue that the CJK IMEs default mode on the Omnibox is Latin/English. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « ui/base/ime/input_method_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 void IMM32Manager::SetInputLanguage() { 126 void IMM32Manager::SetInputLanguage() {
127 // Retrieve the current input language from the system's keyboard layout. 127 // Retrieve the current input language from the system's keyboard layout.
128 // Using GetKeyboardLayoutName instead of GetKeyboardLayout, because 128 // Using GetKeyboardLayoutName instead of GetKeyboardLayout, because
129 // the language from GetKeyboardLayout is the language under where the 129 // the language from GetKeyboardLayout is the language under where the
130 // keyboard layout is installed. And the language from GetKeyboardLayoutName 130 // keyboard layout is installed. And the language from GetKeyboardLayoutName
131 // indicates the language of the keyboard layout itself. 131 // indicates the language of the keyboard layout itself.
132 // See crbug.com/344834. 132 // See crbug.com/344834.
133 WCHAR keyboard_layout[KL_NAMELENGTH]; 133 WCHAR keyboard_layout[KL_NAMELENGTH];
134 if (::GetKeyboardLayoutNameW(keyboard_layout)) { 134 if (::GetKeyboardLayoutNameW(keyboard_layout)) {
135 input_language_id_ = 135 input_language_id_ =
136 static_cast<LANGID>(_wtoi(&keyboard_layout[KL_NAMELENGTH >> 1])); 136 static_cast<LANGID>(
137 wcstol(&keyboard_layout[KL_NAMELENGTH >> 1], nullptr, 16));
137 } else { 138 } else {
138 input_language_id_ = 0x0409; // Fallback to en-US. 139 input_language_id_ = 0x0409; // Fallback to en-US.
139 } 140 }
140 } 141 }
141 142
142 void IMM32Manager::CreateImeWindow(HWND window_handle) { 143 void IMM32Manager::CreateImeWindow(HWND window_handle) {
143 // When a user disables TSF (Text Service Framework) and CUAS (Cicero 144 // When a user disables TSF (Text Service Framework) and CUAS (Cicero
144 // Unaware Application Support), Chinese IMEs somehow ignore function calls 145 // Unaware Application Support), Chinese IMEs somehow ignore function calls
145 // to ::ImmSetCandidateWindow(), i.e. they do not move their candidate 146 // to ::ImmSetCandidateWindow(), i.e. they do not move their candidate
146 // window to the position given as its parameters, and use the position 147 // window to the position given as its parameters, and use the position
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 | IME_CMODE_KATAKANA 602 | IME_CMODE_KATAKANA
602 | IME_CMODE_FULLSHAPE); 603 | IME_CMODE_FULLSHAPE);
603 break; 604 break;
604 default: 605 default:
605 *open = FALSE; 606 *open = FALSE;
606 break; 607 break;
607 } 608 }
608 } 609 }
609 610
610 } // namespace ui 611 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/input_method_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698