| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 KeyboardCode key_code; | 173 KeyboardCode key_code; |
| 174 uint16 character; | 174 uint16 character; |
| 175 uint32 platform_keycode = 0; | 175 uint32 platform_keycode = 0; |
| 176 if (!keyboard_layout_engine_->Lookup(dom_code, flags, &dom_key, &character, | 176 if (!keyboard_layout_engine_->Lookup(dom_code, flags, &dom_key, &character, |
| 177 &key_code, &platform_keycode)) { | 177 &key_code, &platform_keycode)) { |
| 178 return; | 178 return; |
| 179 } | 179 } |
| 180 if (!repeat) | 180 if (!repeat) |
| 181 UpdateModifier(ModifierDomKeyToEventFlag(dom_key), down); | 181 UpdateModifier(ModifierDomKeyToEventFlag(dom_key), down); |
| 182 | 182 |
| 183 KeyEvent* event = | 183 KeyEvent event(down ? ET_KEY_PRESSED : ET_KEY_RELEASED, key_code, dom_code, |
| 184 new KeyEvent(down ? ET_KEY_PRESSED : ET_KEY_RELEASED, key_code, dom_code, | 184 modifiers_->GetModifierFlags(), dom_key, character); |
| 185 modifiers_->GetModifierFlags(), dom_key, character); | |
| 186 if (platform_keycode) | 185 if (platform_keycode) |
| 187 event->set_platform_keycode(platform_keycode); | 186 event.set_platform_keycode(platform_keycode); |
| 188 callback_.Run(make_scoped_ptr(event)); | 187 callback_.Run(&event); |
| 189 } | 188 } |
| 190 | 189 |
| 191 } // namespace ui | 190 } // namespace ui |
| OLD | NEW |