OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 PassRefPtrWillBeRawPtr<TextEvent> TextEvent::createForDrop(PassRefPtrWillBeRawPt
r<AbstractView> view, const String& data) | 54 PassRefPtrWillBeRawPtr<TextEvent> TextEvent::createForDrop(PassRefPtrWillBeRawPt
r<AbstractView> view, const String& data) |
55 { | 55 { |
56 return adoptRefWillBeNoop(new TextEvent(view, data, TextEventInputDrop)); | 56 return adoptRefWillBeNoop(new TextEvent(view, data, TextEventInputDrop)); |
57 } | 57 } |
58 | 58 |
59 TextEvent::TextEvent() | 59 TextEvent::TextEvent() |
60 : m_inputType(TextEventInputKeyboard) | 60 : m_inputType(TextEventInputKeyboard) |
61 , m_shouldSmartReplace(false) | 61 , m_shouldSmartReplace(false) |
62 , m_shouldMatchStyle(false) | 62 , m_shouldMatchStyle(false) |
63 { | 63 { |
64 ScriptWrappable::init(this); | |
65 } | 64 } |
66 | 65 |
67 TextEvent::TextEvent(PassRefPtrWillBeRawPtr<AbstractView> view, const String& da
ta, TextEventInputType inputType) | 66 TextEvent::TextEvent(PassRefPtrWillBeRawPtr<AbstractView> view, const String& da
ta, TextEventInputType inputType) |
68 : UIEvent(EventTypeNames::textInput, true, true, view, 0) | 67 : UIEvent(EventTypeNames::textInput, true, true, view, 0) |
69 , m_inputType(inputType) | 68 , m_inputType(inputType) |
70 , m_data(data) | 69 , m_data(data) |
71 , m_pastingFragment(nullptr) | 70 , m_pastingFragment(nullptr) |
72 , m_shouldSmartReplace(false) | 71 , m_shouldSmartReplace(false) |
73 , m_shouldMatchStyle(false) | 72 , m_shouldMatchStyle(false) |
74 { | 73 { |
75 ScriptWrappable::init(this); | |
76 } | 74 } |
77 | 75 |
78 TextEvent::TextEvent(PassRefPtrWillBeRawPtr<AbstractView> view, const String& da
ta, PassRefPtrWillBeRawPtr<DocumentFragment> pastingFragment, | 76 TextEvent::TextEvent(PassRefPtrWillBeRawPtr<AbstractView> view, const String& da
ta, PassRefPtrWillBeRawPtr<DocumentFragment> pastingFragment, |
79 bool shouldSmartReplace, bool shouldMatchStyle) | 77 bool shouldSmartReplace, bool shouldMatchStyle) |
80 : UIEvent(EventTypeNames::textInput, true, true, view, 0) | 78 : UIEvent(EventTypeNames::textInput, true, true, view, 0) |
81 , m_inputType(TextEventInputPaste) | 79 , m_inputType(TextEventInputPaste) |
82 , m_data(data) | 80 , m_data(data) |
83 , m_pastingFragment(pastingFragment) | 81 , m_pastingFragment(pastingFragment) |
84 , m_shouldSmartReplace(shouldSmartReplace) | 82 , m_shouldSmartReplace(shouldSmartReplace) |
85 , m_shouldMatchStyle(shouldMatchStyle) | 83 , m_shouldMatchStyle(shouldMatchStyle) |
86 { | 84 { |
87 ScriptWrappable::init(this); | |
88 } | 85 } |
89 | 86 |
90 TextEvent::~TextEvent() | 87 TextEvent::~TextEvent() |
91 { | 88 { |
92 } | 89 } |
93 | 90 |
94 void TextEvent::initTextEvent(const AtomicString& type, bool canBubble, bool can
celable, PassRefPtrWillBeRawPtr<AbstractView> view, const String& data) | 91 void TextEvent::initTextEvent(const AtomicString& type, bool canBubble, bool can
celable, PassRefPtrWillBeRawPtr<AbstractView> view, const String& data) |
95 { | 92 { |
96 if (dispatched()) | 93 if (dispatched()) |
97 return; | 94 return; |
98 | 95 |
99 initUIEvent(type, canBubble, cancelable, view, 0); | 96 initUIEvent(type, canBubble, cancelable, view, 0); |
100 | 97 |
101 m_data = data; | 98 m_data = data; |
102 } | 99 } |
103 | 100 |
104 const AtomicString& TextEvent::interfaceName() const | 101 const AtomicString& TextEvent::interfaceName() const |
105 { | 102 { |
106 return EventNames::TextEvent; | 103 return EventNames::TextEvent; |
107 } | 104 } |
108 | 105 |
109 void TextEvent::trace(Visitor* visitor) | 106 void TextEvent::trace(Visitor* visitor) |
110 { | 107 { |
111 visitor->trace(m_pastingFragment); | 108 visitor->trace(m_pastingFragment); |
112 UIEvent::trace(visitor); | 109 UIEvent::trace(visitor); |
113 } | 110 } |
114 | 111 |
115 } // namespace blink | 112 } // namespace blink |
OLD | NEW |