OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 26 matching lines...) Expand all Loading... |
37 #include "core/dom/CustomElementCallback.h" | 37 #include "core/dom/CustomElementCallback.h" |
38 #include <v8.h> | 38 #include <v8.h> |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 class Element; | 42 class Element; |
43 class ScriptExecutionContext; | 43 class ScriptExecutionContext; |
44 | 44 |
45 class V8CustomElementCallback : public CustomElementCallback, ActiveDOMCallback
{ | 45 class V8CustomElementCallback : public CustomElementCallback, ActiveDOMCallback
{ |
46 public: | 46 public: |
47 static PassRefPtr<V8CustomElementCallback> create(ScriptExecutionContext*, v
8::Handle<v8::Object> owner, v8::Handle<v8::Function> ready); | 47 static PassRefPtr<V8CustomElementCallback> create(ScriptExecutionContext*, v
8::Handle<v8::Object> owner, v8::Handle<v8::Function> ready, v8::Handle<v8::Func
tion> inserted, v8::Handle<v8::Function> removed); |
48 | 48 |
49 virtual ~V8CustomElementCallback() { } | 49 virtual ~V8CustomElementCallback() { } |
50 | 50 |
51 private: | 51 private: |
52 V8CustomElementCallback(ScriptExecutionContext*, v8::Handle<v8::Function> re
ady); | 52 V8CustomElementCallback(ScriptExecutionContext*, v8::Handle<v8::Function> re
ady, v8::Handle<v8::Function> inserted, v8::Handle<v8::Function> removed); |
53 | 53 |
54 virtual void ready(Element*) OVERRIDE; | 54 virtual void ready(Element*) OVERRIDE; |
| 55 virtual void inserted(Element*) OVERRIDE; |
| 56 virtual void removed(Element*) OVERRIDE; |
| 57 void invoke(const ScopedPersistent<v8::Function>& callback, Element*); |
55 | 58 |
56 RefPtr<DOMWrapperWorld> m_world; | 59 RefPtr<DOMWrapperWorld> m_world; |
57 ScopedPersistent<v8::Function> m_ready; | 60 ScopedPersistent<v8::Function> m_ready; |
| 61 ScopedPersistent<v8::Function> m_inserted; |
| 62 ScopedPersistent<v8::Function> m_removed; |
58 }; | 63 }; |
59 | 64 |
60 } | 65 } |
61 | 66 |
62 #endif // CustomElementCallback_h | 67 #endif // CustomElementCallback_h |
OLD | NEW |