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

Side by Side Diff: content/browser/renderer_host/web_input_event_aura.cc

Issue 8377001: aura: Add touch-event support for RWHVA. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: windows Created 9 years, 2 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/renderer_host/web_input_event_aura.h" 5 #include "content/browser/renderer_host/web_input_event_aura.h"
6 6
7 #include "ui/aura/event.h" 7 #include "ui/aura/event.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 #if defined(OS_WIN) 11 #if defined(OS_WIN)
12 WebKit::WebMouseEvent MakeUntranslatedWebMouseEventFromNativeEvent( 12 WebKit::WebMouseEvent MakeUntranslatedWebMouseEventFromNativeEvent(
13 base::NativeEvent native_event); 13 base::NativeEvent native_event);
14 WebKit::WebMouseWheelEvent MakeUntranslatedWebMouseWheelEventFromNativeEvent( 14 WebKit::WebMouseWheelEvent MakeUntranslatedWebMouseWheelEventFromNativeEvent(
15 base::NativeEvent native_event); 15 base::NativeEvent native_event);
16 WebKit::WebKeyboardEvent MakeWebKeyboardEventFromNativeEvent( 16 WebKit::WebKeyboardEvent MakeWebKeyboardEventFromNativeEvent(
17 base::NativeEvent native_event); 17 base::NativeEvent native_event);
18 WebKit::WebTouchPoint* UpdateWebTouchEventFromNativeEvent(
19 base::NativeEvent native_event, WebKit::WebTouchEvent* web_event);
18 #else 20 #else
19 WebKit::WebMouseEvent MakeWebMouseEventFromAuraEvent(aura::MouseEvent* event); 21 WebKit::WebMouseEvent MakeWebMouseEventFromAuraEvent(aura::MouseEvent* event);
20 WebKit::WebMouseWheelEvent MakeWebMouseWheelEventFromAuraEvent( 22 WebKit::WebMouseWheelEvent MakeWebMouseWheelEventFromAuraEvent(
21 aura::MouseEvent* event); 23 aura::MouseEvent* event);
22 WebKit::WebKeyboardEvent MakeWebKeyboardEventFromAuraEvent( 24 WebKit::WebKeyboardEvent MakeWebKeyboardEventFromAuraEvent(
23 aura::KeyEvent* event); 25 aura::KeyEvent* event);
26 WebKit::WebTouchPoint* UpdateWebTouchEventFromAuraEvent(
27 aura::TouchEvent* event, WebKit::WebTouchEvent* web_event);
24 #endif 28 #endif
25 29
26 // General approach: 30 // General approach:
27 // 31 //
28 // aura::Event only carries a subset of possible event data provided to Aura by 32 // aura::Event only carries a subset of possible event data provided to Aura by
29 // the host platform. WebKit utilizes a larger subset of that information than 33 // the host platform. WebKit utilizes a larger subset of that information than
30 // Aura itself. WebKit includes some built in cracking functionality that we 34 // Aura itself. WebKit includes some built in cracking functionality that we
31 // rely on to obtain this information cleanly and consistently. 35 // rely on to obtain this information cleanly and consistently.
32 // 36 //
33 // The only place where an aura::Event's data differs from what the underlying 37 // The only place where an aura::Event's data differs from what the underlying
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // is_char() == true. We need to pass the aura::KeyEvent to the X11 function 101 // is_char() == true. We need to pass the aura::KeyEvent to the X11 function
98 // to detect this case so the right event type can be constructed. 102 // to detect this case so the right event type can be constructed.
99 #if defined(OS_WIN) 103 #if defined(OS_WIN)
100 // Key events require no translation by the aura system. 104 // Key events require no translation by the aura system.
101 return MakeWebKeyboardEventFromNativeEvent(event->native_event()); 105 return MakeWebKeyboardEventFromNativeEvent(event->native_event());
102 #else 106 #else
103 return MakeWebKeyboardEventFromAuraEvent(event); 107 return MakeWebKeyboardEventFromAuraEvent(event);
104 #endif 108 #endif
105 } 109 }
106 110
111 WebKit::WebTouchPoint* UpdateWebTouchEvent(aura::TouchEvent* event,
112 WebKit::WebTouchEvent* web_event) {
113 #if defined(OS_WIN)
114 return UpdateWebTouchEventFromNativeEvent(event->native_event(), web_event);
115 #else
116 return UpdateWebTouchEventFromAuraEvent(event, web_event);
117 #endif
118 }
119
107 } // namespace content 120 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698