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

Side by Side Diff: content/browser/renderer_host/input/web_input_event_util.cc

Issue 791923003: replace COMPILE_ASSERT with static_assert in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixups Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 // MSVC++ requires this to be set before any other includes to get M_PI. 5 // MSVC++ requires this to be set before any other includes to get M_PI.
6 #define _USE_MATH_DEFINES 6 #define _USE_MATH_DEFINES
7 7
8 #include "content/browser/renderer_host/input/web_input_event_util.h" 8 #include "content/browser/renderer_host/input/web_input_event_util.h"
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 base::snprintf(event->keyIdentifier, 251 base::snprintf(event->keyIdentifier,
252 sizeof(event->keyIdentifier), 252 sizeof(event->keyIdentifier),
253 "U+%04X", 253 "U+%04X",
254 base::ToUpperASCII(static_cast<int>(windows_key_code))); 254 base::ToUpperASCII(static_cast<int>(windows_key_code)));
255 } 255 }
256 } 256 }
257 257
258 blink::WebTouchEvent CreateWebTouchEventFromMotionEvent( 258 blink::WebTouchEvent CreateWebTouchEventFromMotionEvent(
259 const ui::MotionEvent& event, 259 const ui::MotionEvent& event,
260 bool may_cause_scrolling) { 260 bool may_cause_scrolling) {
261 COMPILE_ASSERT(static_cast<int>(MotionEvent::MAX_TOUCH_POINT_COUNT) == 261 static_assert(static_cast<int>(MotionEvent::MAX_TOUCH_POINT_COUNT) ==
262 static_cast<int>(blink::WebTouchEvent::touchesLengthCap), 262 static_cast<int>(blink::WebTouchEvent::touchesLengthCap),
263 inconsistent_maximum_number_of_active_touch_points); 263 "inconsistent maximum number of active touch points");
264 264
265 blink::WebTouchEvent result; 265 blink::WebTouchEvent result;
266 266
267 WebTouchEventTraits::ResetType( 267 WebTouchEventTraits::ResetType(
268 ToWebInputEventType(event.GetAction()), 268 ToWebInputEventType(event.GetAction()),
269 (event.GetEventTime() - base::TimeTicks()).InSecondsF(), 269 (event.GetEventTime() - base::TimeTicks()).InSecondsF(),
270 &result); 270 &result);
271 result.causesScrollingIfUncanceled = may_cause_scrolling; 271 result.causesScrollingIfUncanceled = may_cause_scrolling;
272 272
273 result.modifiers = EventFlagsToWebEventModifiers(event.GetFlags()); 273 result.modifiers = EventFlagsToWebEventModifiers(event.GetFlags());
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 flags |= ui::EF_CAPS_LOCK_DOWN; 453 flags |= ui::EF_CAPS_LOCK_DOWN;
454 if (modifiers & blink::WebInputEvent::IsAutoRepeat) 454 if (modifiers & blink::WebInputEvent::IsAutoRepeat)
455 flags |= ui::EF_IS_REPEAT; 455 flags |= ui::EF_IS_REPEAT;
456 if (modifiers & blink::WebInputEvent::IsKeyPad) 456 if (modifiers & blink::WebInputEvent::IsKeyPad)
457 flags |= ui::EF_NUMPAD_KEY; 457 flags |= ui::EF_NUMPAD_KEY;
458 458
459 return flags; 459 return flags;
460 } 460 }
461 461
462 } // namespace content 462 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/power_profiler/power_event.cc ('k') | content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698