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 "ui/base/events/event.h" | 8 #include "ui/base/events/event.h" |
9 #include "ui/base/events/event_constants.h" | 9 #include "ui/base/events/event_constants.h" |
10 #include "ui/base/events/event_utils.h" | 10 #include "ui/base/events/event_utils.h" |
11 #include "ui/base/ime/text_input_client.h" | 11 #include "ui/base/ime/text_input_client.h" |
12 #include "ui/base/keycodes/keyboard_codes.h" | 12 #include "ui/base/keycodes/keyboard_codes.h" |
13 #include "ui/base/win/hwnd_util.h" | 13 #include "ui/gfx/win/hwnd_util.h" |
14 | 14 |
15 namespace ui { | 15 namespace ui { |
16 namespace { | 16 namespace { |
17 | 17 |
18 // Extra number of chars before and after selection (or composition) range which | 18 // Extra number of chars before and after selection (or composition) range which |
19 // is returned to IME for improving conversion accuracy. | 19 // is returned to IME for improving conversion accuracy. |
20 static const size_t kExtraNumberOfChars = 20; | 20 static const size_t kExtraNumberOfChars = 20; |
21 | 21 |
22 } // namespace | 22 } // namespace |
23 | 23 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 // If Windows sends a WM_CHAR, then any previously sent WM_DEADCHARs (which | 152 // If Windows sends a WM_CHAR, then any previously sent WM_DEADCHARs (which |
153 // are displayed as the composition text) should be cleared. | 153 // are displayed as the composition text) should be cleared. |
154 GetTextInputClient()->ClearCompositionText(); | 154 GetTextInputClient()->ClearCompositionText(); |
155 } | 155 } |
156 | 156 |
157 // Explicitly show the system menu at a good location on [Alt]+[Space]. | 157 // Explicitly show the system menu at a good location on [Alt]+[Space]. |
158 // Note: Setting |handled| to FALSE for DefWindowProc triggering of the system | 158 // Note: Setting |handled| to FALSE for DefWindowProc triggering of the system |
159 // menu causes undesirable titlebar artifacts in the classic theme. | 159 // menu causes undesirable titlebar artifacts in the classic theme. |
160 if (message == WM_SYSCHAR && wparam == VK_SPACE) | 160 if (message == WM_SYSCHAR && wparam == VK_SPACE) |
161 ui::ShowSystemMenu(window_handle); | 161 gfx::ShowSystemMenu(window_handle); |
162 | 162 |
163 return 0; | 163 return 0; |
164 } | 164 } |
165 | 165 |
166 LRESULT InputMethodWin::OnDeadChar(UINT message, | 166 LRESULT InputMethodWin::OnDeadChar(UINT message, |
167 WPARAM wparam, | 167 WPARAM wparam, |
168 LPARAM lparam, | 168 LPARAM lparam, |
169 BOOL* handled) { | 169 BOOL* handled) { |
170 *handled = TRUE; | 170 *handled = TRUE; |
171 | 171 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 // receiving keyboard input as long as it is an active window. This works well | 361 // receiving keyboard input as long as it is an active window. This works well |
362 // even when the |attached_window_handle| becomes active but has not received | 362 // even when the |attached_window_handle| becomes active but has not received |
363 // WM_FOCUS yet. | 363 // WM_FOCUS yet. |
364 return attached_window_handle && GetActiveWindow() == attached_window_handle; | 364 return attached_window_handle && GetActiveWindow() == attached_window_handle; |
365 #else | 365 #else |
366 return attached_window_handle && GetFocus() == attached_window_handle; | 366 return attached_window_handle && GetFocus() == attached_window_handle; |
367 #endif | 367 #endif |
368 } | 368 } |
369 | 369 |
370 } // namespace ui | 370 } // namespace ui |
OLD | NEW |