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

Unified Diff: sky/engine/core/dom/custom2/new_custom_element_registry.cc

Issue 946083003: Rename Sky's custom2 to custom (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « sky/engine/core/dom/custom2/new_custom_element_registry.h ('k') | sky/engine/web/WebElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/custom2/new_custom_element_registry.cc
diff --git a/sky/engine/core/dom/custom2/new_custom_element_registry.cc b/sky/engine/core/dom/custom2/new_custom_element_registry.cc
deleted file mode 100644
index 171d0203f7f045d95e89db2e313a826b38c3390d..0000000000000000000000000000000000000000
--- a/sky/engine/core/dom/custom2/new_custom_element_registry.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sky/engine/config.h"
-#include "sky/engine/core/dom/custom2/new_custom_element_registry.h"
-
-#include "sky/engine/core/dom/Element.h"
-#include "sky/engine/core/html/HTMLElement.h"
-
-namespace blink {
-
-NewCustomElementRegistry::NewCustomElementRegistry() {
-}
-
-NewCustomElementRegistry::~NewCustomElementRegistry() {
-}
-
-void NewCustomElementRegistry::RegisterElement(const AtomicString& name,
- PassRefPtr<DartValue> type) {
- if (!dart_state_)
- dart_state_ = type->dart_state();
- DCHECK(dart_state_.get() == type->dart_state().get());
-
- auto result = registrations_.add(name, type);
- if (!result.isNewEntry) {
- // TODO(abarth): Handle the case of multiple registrations.
- }
-}
-
-PassRefPtr<Element> NewCustomElementRegistry::CreateElement(
- Document& document, const AtomicString& name) {
- const auto& it = registrations_.find(name);
- if (it != registrations_.end()) {
- DartState::Scope scope(dart_state_.get());
- Dart_Handle type = it->value->dart_value();
- Dart_Handle wrapper = Dart_New(type, Dart_EmptyString(), 0, nullptr);
- if (!LogIfError(wrapper)) {
- RefPtr<Element> element = DartConverter<Element*>::FromDart(wrapper);
- DCHECK(element);
- DCHECK(element->isUpgradedCustomElement());
- return element.release();
- }
- }
- return HTMLElement::create(QualifiedName(name), document);
-}
-
-} // namespace blink
« no previous file with comments | « sky/engine/core/dom/custom2/new_custom_element_registry.h ('k') | sky/engine/web/WebElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698