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

Unified Diff: lib/custom_element_proxy.dart

Issue 1091903002: Move DomProxyMixin to this package (Closed) Base URL: git@github.com:dart-lang/web-components.git@master
Patch Set: format Created 5 years, 8 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 | « lib/build/mirrors_remover.dart ('k') | lib/src/init.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/custom_element_proxy.dart
diff --git a/lib/custom_element_proxy.dart b/lib/custom_element_proxy.dart
index 01e63d5c3e7618d1c1ccdaddfc67d1d3ac8b5943..4f57097c6d20e50d2e18103e39df0eb7a94afeae 100644
--- a/lib/custom_element_proxy.dart
+++ b/lib/custom_element_proxy.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
library web_components.custom_element_proxy;
+import 'dart:js' as js;
import 'package:initialize/initialize.dart';
import 'interop.dart';
@@ -22,3 +23,17 @@ class CustomElementProxy implements Initializer<Type> {
registerDartType(tagName, t, extendsTag: extendsTag);
}
}
+
+/// A simple mixin to make it easier to interoperate with the Javascript API of
+/// a browser object. This is mainly used by classes that expose a Dart API for
+/// Javascript custom elements.
+class CustomElementProxyMixin {
+ js.JsObject _proxy;
+
+ js.JsObject get jsElement {
+ if (_proxy == null) {
+ _proxy = new js.JsObject.fromBrowserObject(this);
+ }
+ return _proxy;
+ }
+}
« no previous file with comments | « lib/build/mirrors_remover.dart ('k') | lib/src/init.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698