| 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 17 matching lines...) Expand all Loading... |
| 28 #include "ui/keyboard/keyboard_switches.h" | 28 #include "ui/keyboard/keyboard_switches.h" |
| 29 #include "url/gurl.h" | 29 #include "url/gurl.h" |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 const char kKeyDown[] ="keydown"; | 33 const char kKeyDown[] ="keydown"; |
| 34 const char kKeyUp[] = "keyup"; | 34 const char kKeyUp[] = "keyup"; |
| 35 | 35 |
| 36 void SendProcessKeyEvent(ui::EventType type, | 36 void SendProcessKeyEvent(ui::EventType type, |
| 37 aura::WindowTreeHost* host) { | 37 aura::WindowTreeHost* host) { |
| 38 ui::KeyEvent event(type, ui::VKEY_PROCESSKEY, ui::DomCode::NONE, ui::EF_NONE, | 38 ui::KeyEvent event(type, ui::VKEY_PROCESSKEY, ui::DomCode::NONE, |
| 39 ui::DomKey::PROCESS, 0, ui::EventTimeForNow()); | 39 ui::EF_IS_SYNTHESIZED, ui::DomKey::PROCESS, 0, |
| 40 ui::EventTimeForNow()); |
| 40 ui::EventDispatchDetails details = | 41 ui::EventDispatchDetails details = |
| 41 host->event_processor()->OnEventFromSource(&event); | 42 host->event_processor()->OnEventFromSource(&event); |
| 42 CHECK(!details.dispatcher_destroyed); | 43 CHECK(!details.dispatcher_destroyed); |
| 43 } | 44 } |
| 44 | 45 |
| 45 base::LazyInstance<base::Time> g_keyboard_load_time_start = | 46 base::LazyInstance<base::Time> g_keyboard_load_time_start = |
| 46 LAZY_INSTANCE_INITIALIZER; | 47 LAZY_INSTANCE_INITIALIZER; |
| 47 | 48 |
| 48 bool g_accessibility_keyboard_enabled = false; | 49 bool g_accessibility_keyboard_enabled = false; |
| 49 | 50 |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } | 451 } |
| 451 | 452 |
| 452 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 453 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
| 453 UMA_HISTOGRAM_ENUMERATION( | 454 UMA_HISTOGRAM_ENUMERATION( |
| 454 "VirtualKeyboard.KeyboardControlEvent", | 455 "VirtualKeyboard.KeyboardControlEvent", |
| 455 event, | 456 event, |
| 456 keyboard::KEYBOARD_CONTROL_MAX); | 457 keyboard::KEYBOARD_CONTROL_MAX); |
| 457 } | 458 } |
| 458 | 459 |
| 459 } // namespace keyboard | 460 } // namespace keyboard |
| OLD | NEW |