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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
341 | 341 |
342 ui::DomCode dom_code = ui::KeycodeConverter::CodeStringToDomCode(key_name); | 342 ui::DomCode dom_code = ui::KeycodeConverter::CodeStringToDomCode(key_name); |
343 if (dom_code == ui::DomCode::NONE) | 343 if (dom_code == ui::DomCode::NONE) |
344 dom_code = ui::UsLayoutKeyboardCodeToDomCode(code); | 344 dom_code = ui::UsLayoutKeyboardCodeToDomCode(code); |
345 CHECK(dom_code != ui::DomCode::NONE); | 345 CHECK(dom_code != ui::DomCode::NONE); |
346 ui::KeyEvent event( | 346 ui::KeyEvent event( |
347 event_type, | 347 event_type, |
348 code, | 348 code, |
349 dom_code, | 349 dom_code, |
350 modifiers); | 350 modifiers); |
351 if (input_method) { | 351 ui::EventDispatchDetails details = |
352 input_method->DispatchKeyEvent(&event); | 352 host->event_sink()->OnEventFromSource(&event); |
353 } else { | 353 CHECK(!details.dispatcher_destroyed); |
sadrul
2017/06/20 12:56:10
Just to confirm: is there a difference to whether
Hadi
2017/06/20 14:41:11
WindowEventDispatcher sends the key event to Input
| |
354 ui::EventDispatchDetails details = | |
355 host->event_sink()->OnEventFromSource(&event); | |
356 CHECK(!details.dispatcher_destroyed); | |
357 } | |
358 } | 354 } |
359 return true; | 355 return true; |
360 } | 356 } |
361 | 357 |
362 void MarkKeyboardLoadStarted() { | 358 void MarkKeyboardLoadStarted() { |
363 if (g_keyboard_load_time_start.Get().is_null()) | 359 if (g_keyboard_load_time_start.Get().is_null()) |
364 g_keyboard_load_time_start.Get() = base::Time::Now(); | 360 g_keyboard_load_time_start.Get() = base::Time::Now(); |
365 } | 361 } |
366 | 362 |
367 void MarkKeyboardLoadFinished() { | 363 void MarkKeyboardLoadFinished() { |
(...skipping 11 matching lines...) Expand all Loading... | |
379 logged = true; | 375 logged = true; |
380 } | 376 } |
381 } | 377 } |
382 | 378 |
383 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 379 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
384 UMA_HISTOGRAM_ENUMERATION("VirtualKeyboard.KeyboardControlEvent", event, | 380 UMA_HISTOGRAM_ENUMERATION("VirtualKeyboard.KeyboardControlEvent", event, |
385 KEYBOARD_CONTROL_MAX); | 381 KEYBOARD_CONTROL_MAX); |
386 } | 382 } |
387 | 383 |
388 } // namespace keyboard | 384 } // namespace keyboard |
OLD | NEW |