Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: ui/events/ozone/events_ozone.cc

Issue 590523004: [Ozone] Fix DCHECK and check for scroll events as well (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/events/ozone/events_ozone.h" 5 #include "ui/events/ozone/events_ozone.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/event_utils.h" 9 #include "ui/events/event_utils.h"
10 10
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) { 39 gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
40 return EventSystemLocationFromNative(native_event); 40 return EventSystemLocationFromNative(native_event);
41 } 41 }
42 42
43 int GetChangedMouseButtonFlagsFromNative( 43 int GetChangedMouseButtonFlagsFromNative(
44 const base::NativeEvent& native_event) { 44 const base::NativeEvent& native_event) {
45 const ui::MouseEvent* event = 45 const ui::MouseEvent* event =
46 static_cast<const ui::MouseEvent*>(native_event); 46 static_cast<const ui::MouseEvent*>(native_event);
47 DCHECK(event->IsMouseEvent()); 47 DCHECK(event->IsMouseEvent() || event->IsScrollEvent());
48 return event->changed_button_flags(); 48 return event->changed_button_flags();
49 } 49 }
50 50
51 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { 51 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) {
52 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event); 52 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event);
53 DCHECK(event->IsKeyEvent()); 53 DCHECK(event->IsKeyEvent());
54 return event->key_code(); 54 return event->key_code();
55 } 55 }
56 56
57 const char* CodeFromNative(const base::NativeEvent& native_event) { 57 const char* CodeFromNative(const base::NativeEvent& native_event) {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 callback.Run(&touch_event); 207 callback.Run(&touch_event);
208 } else if (native_ui_event->IsScrollEvent()) { 208 } else if (native_ui_event->IsScrollEvent()) {
209 ui::ScrollEvent scroll_event(native_event); 209 ui::ScrollEvent scroll_event(native_event);
210 callback.Run(&scroll_event); 210 callback.Run(&scroll_event);
211 } else { 211 } else {
212 NOTREACHED(); 212 NOTREACHED();
213 } 213 }
214 } 214 }
215 215
216 } // namespace ui 216 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698