| 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/ime/text_input_client.h" | 8 #include "ui/base/ime/text_input_client.h" |
| 9 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
| 10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 // Explicitly show the system menu at a good location on [Alt]+[Space]. | 151 // Explicitly show the system menu at a good location on [Alt]+[Space]. |
| 152 // Note: Setting |handled| to FALSE for DefWindowProc triggering of the system | 152 // Note: Setting |handled| to FALSE for DefWindowProc triggering of the system |
| 153 // menu causes undesirable titlebar artifacts in the classic theme. | 153 // menu causes undesirable titlebar artifacts in the classic theme. |
| 154 if (message == WM_SYSCHAR && wparam == VK_SPACE) | 154 if (message == WM_SYSCHAR && wparam == VK_SPACE) |
| 155 gfx::ShowSystemMenu(window_handle); | 155 gfx::ShowSystemMenu(window_handle); |
| 156 | 156 |
| 157 return 0; | 157 return 0; |
| 158 } | 158 } |
| 159 | 159 |
| 160 LRESULT InputMethodWin::OnDeadChar(UINT message, | |
| 161 WPARAM wparam, | |
| 162 LPARAM lparam, | |
| 163 BOOL* handled) { | |
| 164 *handled = TRUE; | |
| 165 return 0; | |
| 166 } | |
| 167 | |
| 168 LRESULT InputMethodWin::OnDocumentFeed(RECONVERTSTRING* reconv) { | 160 LRESULT InputMethodWin::OnDocumentFeed(RECONVERTSTRING* reconv) { |
| 169 ui::TextInputClient* client = GetTextInputClient(); | 161 ui::TextInputClient* client = GetTextInputClient(); |
| 170 if (!client) | 162 if (!client) |
| 171 return 0; | 163 return 0; |
| 172 | 164 |
| 173 gfx::Range text_range; | 165 gfx::Range text_range; |
| 174 if (!client->GetTextRange(&text_range) || text_range.is_empty()) | 166 if (!client->GetTextRange(&text_range) || text_range.is_empty()) |
| 175 return 0; | 167 return 0; |
| 176 | 168 |
| 177 bool result = false; | 169 bool result = false; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 if (GetTextInputClient()) { | 331 if (GetTextInputClient()) { |
| 340 GetTextInputClient()->InsertChar(event.key_code(), | 332 GetTextInputClient()->InsertChar(event.key_code(), |
| 341 ui::GetModifiersFromKeyState()); | 333 ui::GetModifiersFromKeyState()); |
| 342 return true; | 334 return true; |
| 343 } | 335 } |
| 344 } | 336 } |
| 345 return DispatchKeyEventPostIME(event); | 337 return DispatchKeyEventPostIME(event); |
| 346 } | 338 } |
| 347 | 339 |
| 348 } // namespace ui | 340 } // namespace ui |
| OLD | NEW |