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

Side by Side Diff: lib/src/common/polymer_mixin.dart

Issue 1290643006: First cut at behaviors. This just implements the lifecycle methodsportion. We may get the rest for … (Closed) Base URL: git@github.com:dart-lang/polymer-dart.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library polymer.src.common.polymer_js_proxy; 4 library polymer.src.common.polymer_js_proxy;
5 5
6 import 'dart:html'; 6 import 'dart:html';
7 import 'dart:js'; 7 import 'dart:js';
8 import 'package:polymer_interop/polymer_interop.dart' show Polymer, PolymerDom; 8 import 'package:polymer_interop/polymer_interop.dart' show Polymer, PolymerDom;
9 import 'package:web_components/web_components.dart';
9 import 'js_proxy.dart'; 10 import 'js_proxy.dart';
10 11
11 12
12 /// Basic api for re-using the polymer js prototypes. 13 /// Basic api for re-using the polymer js prototypes.
13 abstract class PolymerMixin implements JsProxy { 14 abstract class PolymerMixin implements JsProxy, CustomElementProxyMixin {
14 JsObject _proxy; 15 JsObject _proxy;
15 16
16 JsObject get jsElement { 17 JsObject get jsElement {
17 if (_proxy == null) { 18 if (_proxy == null) {
18 _proxy = new JsObject.fromBrowserObject(this); 19 _proxy = new JsObject.fromBrowserObject(this);
19 _proxy['__data__'] = jsProxy; 20 _proxy['__data__'] = jsProxy;
20 } 21 }
21 return _proxy; 22 return _proxy;
22 } 23 }
23 24
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 throw 'All elements on path $path must be annoted with ' 214 throw 'All elements on path $path must be annoted with '
214 '@jsProxyReflectable, `${parts.length[i - 1]}` was not.'; 215 '@jsProxyReflectable, `${parts.length[i - 1]}` was not.';
215 } 216 }
216 obj = mirror.invokeGetter(parts[i]); 217 obj = mirror.invokeGetter(parts[i]);
217 } 218 }
218 return obj; 219 return obj;
219 } 220 }
220 } 221 }
221 222
222 class Foo extends Object with Polymer, Polymer, Polymer {} 223 class Foo extends Object with Polymer, Polymer, Polymer {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698