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 10 matching lines...) Expand all Loading... |
21 #include "ui/keyboard/keyboard_switches.h" | 21 #include "ui/keyboard/keyboard_switches.h" |
22 #include "url/gurl.h" | 22 #include "url/gurl.h" |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 const char kKeyDown[] ="keydown"; | 26 const char kKeyDown[] ="keydown"; |
27 const char kKeyUp[] = "keyup"; | 27 const char kKeyUp[] = "keyup"; |
28 | 28 |
29 void SendProcessKeyEvent(ui::EventType type, | 29 void SendProcessKeyEvent(ui::EventType type, |
30 aura::WindowTreeHost* host) { | 30 aura::WindowTreeHost* host) { |
31 ui::TranslatedKeyEvent event(type == ui::ET_KEY_PRESSED, | 31 ui::KeyEvent event(type, ui::VKEY_PROCESSKEY, ui::EF_NONE, false); |
32 ui::VKEY_PROCESSKEY, | 32 event.SetTranslated(true); |
33 ui::EF_NONE); | |
34 ui::EventDispatchDetails details = | 33 ui::EventDispatchDetails details = |
35 host->event_processor()->OnEventFromSource(&event); | 34 host->event_processor()->OnEventFromSource(&event); |
36 CHECK(!details.dispatcher_destroyed); | 35 CHECK(!details.dispatcher_destroyed); |
37 } | 36 } |
38 | 37 |
39 base::LazyInstance<base::Time> g_keyboard_load_time_start = | 38 base::LazyInstance<base::Time> g_keyboard_load_time_start = |
40 LAZY_INSTANCE_INITIALIZER; | 39 LAZY_INSTANCE_INITIALIZER; |
41 | 40 |
42 bool g_accessibility_keyboard_enabled = false; | 41 bool g_accessibility_keyboard_enabled = false; |
43 | 42 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 } | 337 } |
339 | 338 |
340 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 339 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
341 UMA_HISTOGRAM_ENUMERATION( | 340 UMA_HISTOGRAM_ENUMERATION( |
342 "VirtualKeyboard.KeyboardControlEvent", | 341 "VirtualKeyboard.KeyboardControlEvent", |
343 event, | 342 event, |
344 keyboard::KEYBOARD_CONTROL_MAX); | 343 keyboard::KEYBOARD_CONTROL_MAX); |
345 } | 344 } |
346 | 345 |
347 } // namespace keyboard | 346 } // namespace keyboard |
OLD | NEW |