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

Unified Diff: sky/engine/bindings-dart/core/dart/DartCustomElementLifecycleCallbacks.h

Issue 875013003: Import Dart bindings as of Blink r188698. This merely copies the files over and does not attach any… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698