OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "ClipboardEvent.h" | 35 #include "ClipboardEvent.h" |
36 #include "Event.h" | 36 #include "Event.h" |
37 #include "EventHeaders.h" | 37 #include "EventHeaders.h" |
38 #include "EventInterfaces.h" | 38 #include "EventInterfaces.h" |
39 #include "EventNames.h" | 39 #include "EventNames.h" |
40 #include "V8Binding.h" | 40 #include "V8Binding.h" |
41 #include "V8Clipboard.h" | 41 #include "V8Clipboard.h" |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
| 45 v8::Handle<v8::Value> V8Event::dataTransferAttrGetterCustom(v8::Local<v8::String
> name, const v8::AccessorInfo& info) |
| 46 { |
| 47 Event* event = V8Event::toNative(info.Holder()); |
| 48 |
| 49 if (event->isDragEvent()) |
| 50 return toV8Fast(static_cast<MouseEvent*>(event)->clipboard(), info, even
t); |
| 51 |
| 52 return v8::Undefined(); |
| 53 } |
| 54 |
45 v8::Handle<v8::Value> V8Event::clipboardDataAttrGetterCustom(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) | 55 v8::Handle<v8::Value> V8Event::clipboardDataAttrGetterCustom(v8::Local<v8::Strin
g> name, const v8::AccessorInfo& info) |
46 { | 56 { |
47 Event* event = V8Event::toNative(info.Holder()); | 57 Event* event = V8Event::toNative(info.Holder()); |
48 | 58 |
49 if (event->isClipboardEvent()) | 59 if (event->isClipboardEvent()) |
50 return toV8Fast(static_cast<ClipboardEvent*>(event)->clipboard(), info,
event); | 60 return toV8Fast(static_cast<ClipboardEvent*>(event)->clipboard(), info,
event); |
51 | 61 |
52 return v8::Undefined(); | 62 return v8::Undefined(); |
53 } | 63 } |
54 | 64 |
(...skipping 10 matching lines...) Expand all Loading... |
65 // We need to check Event first to avoid infinite recursion. | 75 // We need to check Event first to avoid infinite recursion. |
66 if (eventNames().interfaceForEvent == desiredInterface) | 76 if (eventNames().interfaceForEvent == desiredInterface) |
67 return V8Event::createWrapper(event, creationContext, isolate); | 77 return V8Event::createWrapper(event, creationContext, isolate); |
68 | 78 |
69 DOM_EVENT_INTERFACES_FOR_EACH(TRY_TO_WRAP_WITH_INTERFACE) | 79 DOM_EVENT_INTERFACES_FOR_EACH(TRY_TO_WRAP_WITH_INTERFACE) |
70 | 80 |
71 return V8Event::createWrapper(event, creationContext, isolate); | 81 return V8Event::createWrapper(event, creationContext, isolate); |
72 } | 82 } |
73 | 83 |
74 } // namespace WebCore | 84 } // namespace WebCore |
OLD | NEW |