Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / dom / custom / CustomElementLifecycleCallbacks.h
index aa182e6..d04ecbc 100644 (file)
@@ -34,7 +34,7 @@
 #include "wtf/RefCounted.h"
 #include "wtf/text/AtomicString.h"
 
-namespace WebCore {
+namespace blink {
 
 class Element;
 
@@ -42,33 +42,28 @@ class CustomElementLifecycleCallbacks : public RefCounted<CustomElementLifecycle
 public:
     virtual ~CustomElementLifecycleCallbacks() { }
 
-    bool hasCreatedCallback() const { return m_which & Created; }
-    virtual void created(Element*) = 0;
+    enum CallbackType {
+        None                     = 0,
+        CreatedCallback          = 1 << 0,
+        AttachedCallback         = 1 << 1,
+        DetachedCallback         = 1 << 2,
+        AttributeChangedCallback = 1 << 3
+    };
 
-    bool hasAttachedCallback() const { return m_which & Attached; }
-    virtual void attached(Element*) = 0;
+    bool hasCallback(CallbackType type) const { return m_callbackType & type; }
 
-    bool hasDetachedCallback() const { return m_which & Detached; }
+    virtual void created(Element*) = 0;
+    virtual void attached(Element*) = 0;
     virtual void detached(Element*) = 0;
-
-    bool hasAttributeChangedCallback() const { return m_which & AttributeChanged; }
     virtual void attributeChanged(Element*, const AtomicString& name, const AtomicString& oldValue, const AtomicString& newValue) = 0;
 
-    enum CallbackType {
-        None             = 0,
-        Created          = 1 << 0,
-        Attached         = 1 << 1,
-        Detached         = 1 << 2,
-        AttributeChanged = 1 << 3
-    };
-
 protected:
-    CustomElementLifecycleCallbacks(CallbackType which) : m_which(which) { }
+    CustomElementLifecycleCallbacks(CallbackType type) : m_callbackType(type) { }
 
 private:
-    CallbackType m_which;
+    CallbackType m_callbackType;
 };
 
-}
+} // namespace blink
 
 #endif // CustomElementLifecycleCallbacks_h