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

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

Issue 491073002: [Ozone] Check valid GetFlingData parameters before writing to them (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« 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/event.h" 5 #include "ui/events/event.h"
6 #include "ui/events/event_constants.h" 6 #include "ui/events/event_constants.h"
7 #include "ui/events/event_utils.h" 7 #include "ui/events/event_utils.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 bool GetFlingData(const base::NativeEvent& native_event, 138 bool GetFlingData(const base::NativeEvent& native_event,
139 float* vx, 139 float* vx,
140 float* vy, 140 float* vy,
141 float* vx_ordinal, 141 float* vx_ordinal,
142 float* vy_ordinal, 142 float* vy_ordinal,
143 bool* is_cancel) { 143 bool* is_cancel) {
144 const ui::ScrollEvent* event = 144 const ui::ScrollEvent* event =
145 static_cast<const ui::ScrollEvent*>(native_event); 145 static_cast<const ui::ScrollEvent*>(native_event);
146 DCHECK(event->IsScrollEvent()); 146 DCHECK(event->IsScrollEvent());
147 *vx = event->x_offset(); 147 if (vx)
148 *vy = event->y_offset(); 148 *vx = event->x_offset();
149 *vx_ordinal = event->x_offset_ordinal(); 149 if (vy)
150 *vy_ordinal = event->y_offset_ordinal(); 150 *vy = event->y_offset();
151 *is_cancel = event->type() == ET_SCROLL_FLING_CANCEL; 151 if (vx_ordinal)
152 *vx_ordinal = event->x_offset_ordinal();
153 if (vy_ordinal)
154 *vy_ordinal = event->y_offset_ordinal();
155 if (is_cancel)
156 *is_cancel = event->type() == ET_SCROLL_FLING_CANCEL;
157
152 return true; 158 return true;
153 } 159 }
154 160
155 int GetModifiersFromKeyState() { 161 int GetModifiersFromKeyState() {
156 NOTIMPLEMENTED(); 162 NOTIMPLEMENTED();
157 return 0; 163 return 0;
158 } 164 }
159 165
160 } // namespace ui 166 } // 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