OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/keyboard/keyboard_util.h" | 5 #include "ui/keyboard/keyboard_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 dom_code = ui::KeycodeConverter::CodeStringToDomCode(key_name.c_str()); | 320 dom_code = ui::KeycodeConverter::CodeStringToDomCode(key_name.c_str()); |
321 if (dom_code == ui::DomCode::NONE) | 321 if (dom_code == ui::DomCode::NONE) |
322 dom_code = ui::UsLayoutKeyboardCodeToDomCode(code); | 322 dom_code = ui::UsLayoutKeyboardCodeToDomCode(code); |
323 CHECK(dom_code != ui::DomCode::NONE); | 323 CHECK(dom_code != ui::DomCode::NONE); |
324 ui::KeyEvent event( | 324 ui::KeyEvent event( |
325 event_type, | 325 event_type, |
326 code, | 326 code, |
327 dom_code, | 327 dom_code, |
328 modifiers); | 328 modifiers); |
329 if (input_method) { | 329 if (input_method) { |
330 input_method->DispatchKeyEvent(event); | 330 input_method->DispatchKeyEvent(&event); |
331 } else { | 331 } else { |
332 ui::EventDispatchDetails details = | 332 ui::EventDispatchDetails details = |
333 host->event_processor()->OnEventFromSource(&event); | 333 host->event_processor()->OnEventFromSource(&event); |
334 CHECK(!details.dispatcher_destroyed); | 334 CHECK(!details.dispatcher_destroyed); |
335 } | 335 } |
336 } | 336 } |
337 return true; | 337 return true; |
338 } | 338 } |
339 | 339 |
340 void MarkKeyboardLoadStarted() { | 340 void MarkKeyboardLoadStarted() { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 } | 453 } |
454 | 454 |
455 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 455 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
456 UMA_HISTOGRAM_ENUMERATION( | 456 UMA_HISTOGRAM_ENUMERATION( |
457 "VirtualKeyboard.KeyboardControlEvent", | 457 "VirtualKeyboard.KeyboardControlEvent", |
458 event, | 458 event, |
459 keyboard::KEYBOARD_CONTROL_MAX); | 459 keyboard::KEYBOARD_CONTROL_MAX); |
460 } | 460 } |
461 | 461 |
462 } // namespace keyboard | 462 } // namespace keyboard |
OLD | NEW |