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

Side by Side Diff: Source/core/events/UIEvent.h

Issue 1161783006: Populates sourceDevice attribute into TouchEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 /* 1 /*
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 11 matching lines...) Expand all
22 */ 22 */
23 23
24 #ifndef UIEvent_h 24 #ifndef UIEvent_h
25 #define UIEvent_h 25 #define UIEvent_h
26 26
27 #include "core/CoreExport.h" 27 #include "core/CoreExport.h"
28 #include "core/events/Event.h" 28 #include "core/events/Event.h"
29 #include "core/events/EventDispatchMediator.h" 29 #include "core/events/EventDispatchMediator.h"
30 #include "core/events/UIEventInit.h" 30 #include "core/events/UIEventInit.h"
31 #include "core/frame/DOMWindow.h" 31 #include "core/frame/DOMWindow.h"
32 #include "core/input/InputDevice.h"
33
34 #include <stdlib.h>
32 35
33 namespace blink { 36 namespace blink {
34 37
35 // FIXME: Get rid of this typedef. 38 // FIXME: Get rid of this typedef.
36 typedef DOMWindow AbstractView; 39 typedef DOMWindow AbstractView;
37 40
38 class CORE_EXPORT UIEvent : public Event { 41 class CORE_EXPORT UIEvent : public Event {
39 DEFINE_WRAPPERTYPEINFO(); 42 DEFINE_WRAPPERTYPEINFO();
40 public: 43 public:
41 static PassRefPtrWillBeRawPtr<UIEvent> create() 44 static PassRefPtrWillBeRawPtr<UIEvent> create()
42 { 45 {
43 return adoptRefWillBeNoop(new UIEvent); 46 return adoptRefWillBeNoop(new UIEvent);
44 } 47 }
45 static PassRefPtrWillBeRawPtr<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, int deta il) 48 static PassRefPtrWillBeRawPtr<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, int deta il)
46 { 49 {
47 return adoptRefWillBeNoop(new UIEvent(type, canBubble, cancelable, view, detail)); 50 return adoptRefWillBeNoop(new UIEvent(type, canBubble, cancelable, view, detail));
48 } 51 }
49 static PassRefPtrWillBeRawPtr<UIEvent> create(const AtomicString& type, cons t UIEventInit& initializer) 52 static PassRefPtrWillBeRawPtr<UIEvent> create(const AtomicString& type, cons t UIEventInit& initializer)
50 { 53 {
51 return adoptRefWillBeNoop(new UIEvent(type, initializer)); 54 return adoptRefWillBeNoop(new UIEvent(type, initializer));
52 } 55 }
53 virtual ~UIEvent(); 56 virtual ~UIEvent();
54 57
55 void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, int detail); 58 void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, int detail);
56 59
57 AbstractView* view() const { return m_view.get(); } 60 AbstractView* view() const { return m_view.get(); }
58 int detail() const { return m_detail; } 61 int detail() const { return m_detail; }
62 InputDevice* sourceDevice() const
63 {
64 return m_sourceDevice.get();
65 }
59 66
60 virtual const AtomicString& interfaceName() const override; 67 virtual const AtomicString& interfaceName() const override;
61 virtual bool isUIEvent() const override final; 68 virtual bool isUIEvent() const override final;
62 69
63 virtual int keyCode() const; 70 virtual int keyCode() const;
64 virtual int charCode() const; 71 virtual int charCode() const;
65 72
66 virtual int layerX(); 73 virtual int layerX();
67 virtual int layerY(); 74 virtual int layerY();
68 75
69 virtual int pageX() const; 76 virtual int pageX() const;
70 virtual int pageY() const; 77 virtual int pageY() const;
71 78
72 virtual int which() const; 79 virtual int which() const;
73 80
74 DECLARE_VIRTUAL_TRACE(); 81 DECLARE_VIRTUAL_TRACE();
75 82
76 protected: 83 protected:
77 UIEvent(); 84 UIEvent();
85 UIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPt rWillBeRawPtr<AbstractView>, int detail, PassRefPtrWillBeRawPtr<InputDevice> sou rceDevice);
78 UIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPt rWillBeRawPtr<AbstractView>, int detail); 86 UIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPt rWillBeRawPtr<AbstractView>, int detail);
79 UIEvent(const AtomicString&, const UIEventInit&); 87 UIEvent(const AtomicString&, const UIEventInit&);
80 88
81 private: 89 private:
82 RefPtrWillBeMember<AbstractView> m_view; 90 RefPtrWillBeMember<AbstractView> m_view;
83 int m_detail; 91 int m_detail;
92 RefPtrWillBeMember<InputDevice> m_sourceDevice;
84 }; 93 };
85 94
86 } // namespace blink 95 } // namespace blink
87 96
88 #endif // UIEvent_h 97 #endif // UIEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698