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

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

Issue 1160753005: Implement UIEvent.sourceDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Set sourceDevice to null except uieventinit 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
32 34
33 namespace blink { 35 namespace blink {
34 36
35 // FIXME: Get rid of this typedef. 37 // FIXME: Get rid of this typedef.
36 typedef DOMWindow AbstractView; 38 typedef DOMWindow AbstractView;
37 39
38 class CORE_EXPORT UIEvent : public Event { 40 class CORE_EXPORT UIEvent : public Event {
39 DEFINE_WRAPPERTYPEINFO(); 41 DEFINE_WRAPPERTYPEINFO();
40 public: 42 public:
41 static PassRefPtrWillBeRawPtr<UIEvent> create() 43 static PassRefPtrWillBeRawPtr<UIEvent> create()
42 { 44 {
43 return adoptRefWillBeNoop(new UIEvent); 45 return adoptRefWillBeNoop(new UIEvent);
44 } 46 }
45 static PassRefPtrWillBeRawPtr<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, int deta il) 47 static PassRefPtrWillBeRawPtr<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, int deta il)
46 { 48 {
47 return adoptRefWillBeNoop(new UIEvent(type, canBubble, cancelable, view, detail)); 49 return adoptRefWillBeNoop(new UIEvent(type, canBubble, cancelable, view, detail));
48 } 50 }
49 static PassRefPtrWillBeRawPtr<UIEvent> create(const AtomicString& type, cons t UIEventInit& initializer) 51 static PassRefPtrWillBeRawPtr<UIEvent> create(const AtomicString& type, cons t UIEventInit& initializer)
50 { 52 {
51 return adoptRefWillBeNoop(new UIEvent(type, initializer)); 53 return adoptRefWillBeNoop(new UIEvent(type, initializer));
52 } 54 }
53 virtual ~UIEvent(); 55 virtual ~UIEvent();
54 56
55 void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, int detail); 57 void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, int detail);
56 58
57 AbstractView* view() const { return m_view.get(); } 59 AbstractView* view() const { return m_view.get(); }
58 int detail() const { return m_detail; } 60 int detail() const { return m_detail; }
61 InputDevice* sourceDevice() const { return m_sourceDevice.get(); }
59 62
60 virtual const AtomicString& interfaceName() const override; 63 virtual const AtomicString& interfaceName() const override;
61 virtual bool isUIEvent() const override final; 64 virtual bool isUIEvent() const override final;
62 65
63 virtual int keyCode() const; 66 virtual int keyCode() const;
64 virtual int charCode() const; 67 virtual int charCode() const;
65 68
66 virtual int layerX(); 69 virtual int layerX();
67 virtual int layerY(); 70 virtual int layerY();
68 71
69 virtual int pageX() const; 72 virtual int pageX() const;
70 virtual int pageY() const; 73 virtual int pageY() const;
71 74
72 virtual int which() const; 75 virtual int which() const;
73 76
74 DECLARE_VIRTUAL_TRACE(); 77 DECLARE_VIRTUAL_TRACE();
75 78
76 protected: 79 protected:
77 UIEvent(); 80 UIEvent();
78 UIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPt rWillBeRawPtr<AbstractView>, int detail); 81 UIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPt rWillBeRawPtr<AbstractView>, int detail);
79 UIEvent(const AtomicString&, const UIEventInit&); 82 UIEvent(const AtomicString&, const UIEventInit&);
80 83
81 private: 84 private:
82 RefPtrWillBeMember<AbstractView> m_view; 85 RefPtrWillBeMember<AbstractView> m_view;
83 int m_detail; 86 int m_detail;
87 PersistentWillBeMember<InputDevice> m_sourceDevice;
84 }; 88 };
85 89
86 } // namespace blink 90 } // namespace blink
87 91
88 #endif // UIEvent_h 92 #endif // UIEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698