| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SKY_ENGINE_CORE_DOM_CUSTOM2_NEW_CUSTOM_ELEMENT_REGISTRY_H_ | 5 #ifndef SKY_ENGINE_CORE_DOM_CUSTOM_NEW_CUSTOM_ELEMENT_REGISTRY_H_ |
| 6 #define SKY_ENGINE_CORE_DOM_CUSTOM2_NEW_CUSTOM_ELEMENT_REGISTRY_H_ | 6 #define SKY_ENGINE_CORE_DOM_CUSTOM_NEW_CUSTOM_ELEMENT_REGISTRY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "sky/engine/core/dom/Element.h" | 10 #include "sky/engine/core/dom/Element.h" |
| 11 #include "sky/engine/tonic/dart_state.h" | 11 #include "sky/engine/tonic/dart_state.h" |
| 12 #include "sky/engine/tonic/dart_value.h" | 12 #include "sky/engine/tonic/dart_value.h" |
| 13 #include "sky/engine/wtf/HashMap.h" | 13 #include "sky/engine/wtf/HashMap.h" |
| 14 #include "sky/engine/wtf/PassRefPtr.h" | 14 #include "sky/engine/wtf/PassRefPtr.h" |
| 15 #include "sky/engine/wtf/RefCounted.h" | 15 #include "sky/engine/wtf/RefCounted.h" |
| 16 #include "sky/engine/wtf/RefPtr.h" | 16 #include "sky/engine/wtf/RefPtr.h" |
| 17 #include "sky/engine/wtf/text/AtomicString.h" | 17 #include "sky/engine/wtf/text/AtomicString.h" |
| 18 | 18 |
| 19 namespace blink { | 19 namespace blink { |
| 20 class Document; | 20 class Document; |
| 21 | 21 |
| 22 class NewCustomElementRegistry : public RefCounted<NewCustomElementRegistry> { | 22 class CustomElementRegistry : public RefCounted<CustomElementRegistry> { |
| 23 public: | 23 public: |
| 24 static PassRefPtr<NewCustomElementRegistry> Create() { | 24 static PassRefPtr<CustomElementRegistry> Create() { |
| 25 return adoptRef(new NewCustomElementRegistry()); | 25 return adoptRef(new CustomElementRegistry()); |
| 26 } | 26 } |
| 27 | 27 |
| 28 ~NewCustomElementRegistry(); | 28 ~CustomElementRegistry(); |
| 29 | 29 |
| 30 void RegisterElement(const AtomicString& name, PassRefPtr<DartValue> type); | 30 void RegisterElement(const AtomicString& name, PassRefPtr<DartValue> type); |
| 31 PassRefPtr<Element> CreateElement(Document& document, const AtomicString& name
); | 31 PassRefPtr<Element> CreateElement(Document& document, const AtomicString& name
); |
| 32 | 32 |
| 33 const base::WeakPtr<DartState>& dart_state() const { return dart_state_; } | 33 const base::WeakPtr<DartState>& dart_state() const { return dart_state_; } |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 NewCustomElementRegistry(); | 36 CustomElementRegistry(); |
| 37 | 37 |
| 38 base::WeakPtr<DartState> dart_state_; | 38 base::WeakPtr<DartState> dart_state_; |
| 39 HashMap<AtomicString, RefPtr<DartValue>> registrations_; | 39 HashMap<AtomicString, RefPtr<DartValue>> registrations_; |
| 40 | 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(NewCustomElementRegistry); | 41 DISALLOW_COPY_AND_ASSIGN(CustomElementRegistry); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 } // namespace blink | 44 } // namespace blink |
| 45 | 45 |
| 46 #endif // SKY_ENGINE_CORE_DOM_CUSTOM2_NEW_CUSTOM_ELEMENT_REGISTRY_H_ | 46 #endif // SKY_ENGINE_CORE_DOM_CUSTOM_NEW_CUSTOM_ELEMENT_REGISTRY_H_ |
| OLD | NEW |