| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/events/ozone/evdev/keyboard_evdev.h" | 5 #include "ui/events/ozone/evdev/keyboard_evdev.h" |
| 6 | 6 |
| 7 #include "ui/events/event.h" | 7 #include "ui/events/event.h" |
| 8 #include "ui/events/event_constants.h" | 8 #include "ui/events/event_constants.h" |
| 9 #include "ui/events/keycodes/dom4/keycode_converter.h" | 9 #include "ui/events/keycodes/dom4/keycode_converter.h" |
| 10 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" | 10 #include "ui/events/ozone/evdev/event_modifiers_evdev.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 KeyboardCode key_code; | 165 KeyboardCode key_code; |
| 166 uint16 character; | 166 uint16 character; |
| 167 uint32 platform_keycode = 0; | 167 uint32 platform_keycode = 0; |
| 168 if (!keyboard_layout_engine_->Lookup(dom_code, flags, &dom_key, &character, | 168 if (!keyboard_layout_engine_->Lookup(dom_code, flags, &dom_key, &character, |
| 169 &key_code, &platform_keycode)) { | 169 &key_code, &platform_keycode)) { |
| 170 return; | 170 return; |
| 171 } | 171 } |
| 172 if (!repeat) | 172 if (!repeat) |
| 173 UpdateModifier(ModifierDomKeyToEventFlag(dom_key), down); | 173 UpdateModifier(ModifierDomKeyToEventFlag(dom_key), down); |
| 174 | 174 |
| 175 KeyEvent* event = | 175 KeyEvent event(down ? ET_KEY_PRESSED : ET_KEY_RELEASED, key_code, dom_code, |
| 176 new KeyEvent(down ? ET_KEY_PRESSED : ET_KEY_RELEASED, key_code, dom_code, | 176 modifiers_->GetModifierFlags(), dom_key, character); |
| 177 modifiers_->GetModifierFlags(), dom_key, character); | |
| 178 if (platform_keycode) | 177 if (platform_keycode) |
| 179 event->set_platform_keycode(platform_keycode); | 178 event.set_platform_keycode(platform_keycode); |
| 180 callback_.Run(make_scoped_ptr(event)); | 179 callback_.Run(&event); |
| 181 } | 180 } |
| 182 | 181 |
| 183 } // namespace ui | 182 } // namespace ui |
| OLD | NEW |