| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 } | 278 } |
| 279 | 279 |
| 280 ui::KeyEvent event(event_type, code, key_name, modifiers); | 280 ui::KeyEvent event(event_type, code, key_name, modifiers); |
| 281 ui::EventDispatchDetails details = | 281 ui::EventDispatchDetails details = |
| 282 host->event_processor()->OnEventFromSource(&event); | 282 host->event_processor()->OnEventFromSource(&event); |
| 283 CHECK(!details.dispatcher_destroyed); | 283 CHECK(!details.dispatcher_destroyed); |
| 284 } | 284 } |
| 285 return true; | 285 return true; |
| 286 } | 286 } |
| 287 | 287 |
| 288 const void MarkKeyboardLoadStarted() { | 288 void MarkKeyboardLoadStarted() { |
| 289 if (!g_keyboard_load_time_start.Get().ToInternalValue()) | 289 if (!g_keyboard_load_time_start.Get().ToInternalValue()) |
| 290 g_keyboard_load_time_start.Get() = base::Time::Now(); | 290 g_keyboard_load_time_start.Get() = base::Time::Now(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 const void MarkKeyboardLoadFinished() { | 293 void MarkKeyboardLoadFinished() { |
| 294 // Possible to get a load finished without a start if navigating directly to | 294 // Possible to get a load finished without a start if navigating directly to |
| 295 // chrome://keyboard. | 295 // chrome://keyboard. |
| 296 if (!g_keyboard_load_time_start.Get().ToInternalValue()) | 296 if (!g_keyboard_load_time_start.Get().ToInternalValue()) |
| 297 return; | 297 return; |
| 298 | 298 |
| 299 // It should not be possible to finish loading the keyboard without starting | 299 // It should not be possible to finish loading the keyboard without starting |
| 300 // to load it first. | 300 // to load it first. |
| 301 DCHECK(g_keyboard_load_time_start.Get().ToInternalValue()); | 301 DCHECK(g_keyboard_load_time_start.Get().ToInternalValue()); |
| 302 | 302 |
| 303 static bool logged = false; | 303 static bool logged = false; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 } | 377 } |
| 378 | 378 |
| 379 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 379 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
| 380 UMA_HISTOGRAM_ENUMERATION( | 380 UMA_HISTOGRAM_ENUMERATION( |
| 381 "VirtualKeyboard.KeyboardControlEvent", | 381 "VirtualKeyboard.KeyboardControlEvent", |
| 382 event, | 382 event, |
| 383 keyboard::KEYBOARD_CONTROL_MAX); | 383 keyboard::KEYBOARD_CONTROL_MAX); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace keyboard | 386 } // namespace keyboard |
| OLD | NEW |