| Index: sky/engine/bindings-dart/core/dart/DartCustomElementLifecycleCallbacks.h
|
| diff --git a/sky/engine/core/dom/custom/CustomElementLifecycleCallbacks.h b/sky/engine/bindings-dart/core/dart/DartCustomElementLifecycleCallbacks.h
|
| similarity index 60%
|
| copy from sky/engine/core/dom/custom/CustomElementLifecycleCallbacks.h
|
| copy to sky/engine/bindings-dart/core/dart/DartCustomElementLifecycleCallbacks.h
|
| index 590b71ee4a28fd26dedc6792c407e81929c07add..c5bc37fa458faf1afb446b2b96cdc4cc4f8df1ab 100644
|
| --- a/sky/engine/core/dom/custom/CustomElementLifecycleCallbacks.h
|
| +++ b/sky/engine/bindings-dart/core/dart/DartCustomElementLifecycleCallbacks.h
|
| @@ -28,42 +28,47 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef SKY_ENGINE_CORE_DOM_CUSTOM_CUSTOMELEMENTLIFECYCLECALLBACKS_H_
|
| -#define SKY_ENGINE_CORE_DOM_CUSTOM_CUSTOMELEMENTLIFECYCLECALLBACKS_H_
|
| +#ifndef DartCustomElementLifecycleCallbacks_h
|
| +#define DartCustomElementLifecycleCallbacks_h
|
|
|
| -#include "sky/engine/wtf/RefCounted.h"
|
| -#include "sky/engine/wtf/text/AtomicString.h"
|
| +#include "bindings/core/v8/DOMWrapperWorld.h"
|
| +#include "core/dom/custom/CustomElementLifecycleCallbacks.h"
|
| +#include "wtf/PassOwnPtr.h"
|
| +#include "wtf/PassRefPtr.h"
|
| +
|
| +#include <dart_api.h>
|
|
|
| namespace blink {
|
|
|
| +class CustomElementDefinition;
|
| +class CustomElementLifecycleCallbacks;
|
| +class DartCustomElementBinding;
|
| +class DartScriptState;
|
| class Element;
|
| +class ExecutionContext;
|
|
|
| -class CustomElementLifecycleCallbacks : public RefCounted<CustomElementLifecycleCallbacks> {
|
| +class DartCustomElementLifecycleCallbacks : public CustomElementLifecycleCallbacks {
|
| public:
|
| - virtual ~CustomElementLifecycleCallbacks() { }
|
| + static PassRefPtr<DartCustomElementLifecycleCallbacks> create(DartScriptState*);
|
| +
|
| + virtual ~DartCustomElementLifecycleCallbacks();
|
|
|
| - enum CallbackType {
|
| - None = 0,
|
| - CreatedCallback = 1 << 0,
|
| - AttachedCallback = 1 << 1,
|
| - DetachedCallback = 1 << 2,
|
| - AttributeChangedCallback = 1 << 3
|
| - };
|
| + bool setBinding(CustomElementDefinition* owner, PassOwnPtr<DartCustomElementBinding>);
|
|
|
| - bool hasCallback(CallbackType type) const { return m_which & type; }
|
| +private:
|
| + DartCustomElementLifecycleCallbacks(DartScriptState*);
|
|
|
| - virtual void created(Element*) = 0;
|
| - virtual void attached(Element*) = 0;
|
| - virtual void detached(Element*) = 0;
|
| - virtual void attributeChanged(Element*, const AtomicString& name, const AtomicString& oldValue, const AtomicString& newValue) = 0;
|
| + virtual void created(Element*) OVERRIDE;
|
| + virtual void attached(Element*) OVERRIDE;
|
| + virtual void detached(Element*) OVERRIDE;
|
| + virtual void attributeChanged(Element*, const AtomicString& name, const AtomicString& oldValue, const AtomicString& newValue) OVERRIDE;
|
|
|
| -protected:
|
| - CustomElementLifecycleCallbacks(CallbackType which) : m_which(which) { }
|
| + void call(const char* methodName, Element*);
|
|
|
| -private:
|
| - CallbackType m_which;
|
| + RefPtr<DartScriptState> m_scriptState;
|
| + CustomElementDefinition* m_owner;
|
| };
|
|
|
| }
|
|
|
| -#endif // SKY_ENGINE_CORE_DOM_CUSTOM_CUSTOMELEMENTLIFECYCLECALLBACKS_H_
|
| +#endif // DartCustomElementLifecycleCallbacks_h
|
|
|