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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 dom_code = ui::KeycodeConverter::CodeStringToDomCode(key_name.c_str()); | 325 dom_code = ui::KeycodeConverter::CodeStringToDomCode(key_name.c_str()); |
326 if (dom_code == ui::DomCode::NONE) | 326 if (dom_code == ui::DomCode::NONE) |
327 dom_code = ui::UsLayoutKeyboardCodeToDomCode(code); | 327 dom_code = ui::UsLayoutKeyboardCodeToDomCode(code); |
328 CHECK(dom_code != ui::DomCode::NONE); | 328 CHECK(dom_code != ui::DomCode::NONE); |
329 ui::KeyEvent event( | 329 ui::KeyEvent event( |
330 event_type, | 330 event_type, |
331 code, | 331 code, |
332 dom_code, | 332 dom_code, |
333 modifiers); | 333 modifiers); |
334 if (input_method) { | 334 if (input_method) { |
335 input_method->DispatchKeyEvent(event); | 335 input_method->DispatchKeyEvent(&event); |
336 } else { | 336 } else { |
337 ui::EventDispatchDetails details = | 337 ui::EventDispatchDetails details = |
338 host->event_processor()->OnEventFromSource(&event); | 338 host->event_processor()->OnEventFromSource(&event); |
339 CHECK(!details.dispatcher_destroyed); | 339 CHECK(!details.dispatcher_destroyed); |
340 } | 340 } |
341 } | 341 } |
342 return true; | 342 return true; |
343 } | 343 } |
344 | 344 |
345 void MarkKeyboardLoadStarted() { | 345 void MarkKeyboardLoadStarted() { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 } | 458 } |
459 | 459 |
460 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 460 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
461 UMA_HISTOGRAM_ENUMERATION( | 461 UMA_HISTOGRAM_ENUMERATION( |
462 "VirtualKeyboard.KeyboardControlEvent", | 462 "VirtualKeyboard.KeyboardControlEvent", |
463 event, | 463 event, |
464 keyboard::KEYBOARD_CONTROL_MAX); | 464 keyboard::KEYBOARD_CONTROL_MAX); |
465 } | 465 } |
466 | 466 |
467 } // namespace keyboard | 467 } // namespace keyboard |
OLD | NEW |