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

Side by Side Diff: ui/events/android/motion_event_android.cc

Issue 1559163002: Clean up event flags a bit: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment Created 4 years, 11 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 | « ui/content_accelerators/accelerator_util.cc ('k') | ui/events/blink/blink_event_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/android/motion_event_android.h" 5 #include "ui/events/android/motion_event_android.h"
6 6
7 #include <android/input.h> 7 #include <android/input.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 int flags = ui::EF_NONE; 82 int flags = ui::EF_NONE;
83 if ((meta_state & AMETA_SHIFT_ON) != 0) 83 if ((meta_state & AMETA_SHIFT_ON) != 0)
84 flags |= ui::EF_SHIFT_DOWN; 84 flags |= ui::EF_SHIFT_DOWN;
85 if ((meta_state & AMETA_CTRL_ON) != 0) 85 if ((meta_state & AMETA_CTRL_ON) != 0)
86 flags |= ui::EF_CONTROL_DOWN; 86 flags |= ui::EF_CONTROL_DOWN;
87 if ((meta_state & AMETA_ALT_ON) != 0) 87 if ((meta_state & AMETA_ALT_ON) != 0)
88 flags |= ui::EF_ALT_DOWN; 88 flags |= ui::EF_ALT_DOWN;
89 if ((meta_state & AMETA_META_ON) != 0) 89 if ((meta_state & AMETA_META_ON) != 0)
90 flags |= ui::EF_COMMAND_DOWN; 90 flags |= ui::EF_COMMAND_DOWN;
91 if ((meta_state & AMETA_CAPS_LOCK_ON) != 0) 91 if ((meta_state & AMETA_CAPS_LOCK_ON) != 0)
92 flags |= ui::EF_CAPS_LOCK_DOWN; 92 flags |= ui::EF_CAPS_LOCK_ON;
93 return flags; 93 return flags;
94 } 94 }
95 95
96 base::TimeTicks FromAndroidTime(int64_t time_ms) { 96 base::TimeTicks FromAndroidTime(int64_t time_ms) {
97 return base::TimeTicks() + base::TimeDelta::FromMilliseconds(time_ms); 97 return base::TimeTicks() + base::TimeDelta::FromMilliseconds(time_ms);
98 } 98 }
99 99
100 float ToValidFloat(float x) { 100 float ToValidFloat(float x) {
101 if (std::isnan(x)) 101 if (std::isnan(x))
102 return 0.f; 102 return 0.f;
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 result.tool_type = FromAndroidToolType(pointer.tool_type); 353 result.tool_type = FromAndroidToolType(pointer.tool_type);
354 return result; 354 return result;
355 } 355 }
356 356
357 // static 357 // static
358 bool MotionEventAndroid::RegisterMotionEventAndroid(JNIEnv* env) { 358 bool MotionEventAndroid::RegisterMotionEventAndroid(JNIEnv* env) {
359 return JNI_MotionEvent::RegisterNativesImpl(env); 359 return JNI_MotionEvent::RegisterNativesImpl(env);
360 } 360 }
361 361
362 } // namespace content 362 } // namespace content
OLDNEW
« no previous file with comments | « ui/content_accelerators/accelerator_util.cc ('k') | ui/events/blink/blink_event_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698