Index: tools/cc-frame-viewer/src/tile_view.js |
diff --git a/tools/cc-frame-viewer/src/tile_view.js b/tools/cc-frame-viewer/src/tile_view.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2dd4b68ed92575dd2454b6bd42be086bbd7728b4 |
--- /dev/null |
+++ b/tools/cc-frame-viewer/src/tile_view.js |
@@ -0,0 +1,41 @@ |
+/* Copyright (c) 2012 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. |
+ */ |
+'use strict'; |
+ |
+base.require('ui'); |
+base.requireStylesheet('tile_view'); |
+base.exportTo('ccfv', function() { |
+ var TileView = ui.define('x-tile-view'); |
+ TileView.prototype = { |
+ __proto__: HTMLUnknownElement.prototype, |
+ |
+ decorate: function() { |
+ this.tile_ = undefined; |
+ }, |
+ |
+ set tile(tile) { |
+ this.tile_ = tile; |
+ this.updateChildren_(); |
+ }, |
+ |
+ updateChildren_: function() { |
+ this.textContent = ''; |
+ if (!this.tile_) |
+ return; |
+ |
+ var simpleObj = {}; |
+ this.tile_.dumpToSimpleObject(simpleObj); |
+ this.textContent = JSON.stringify( |
+ simpleObj, |
+ null, |
+ 2); |
+ } |
+ }; |
+ |
+ return { |
+ TileView: TileView |
+ } |
+}); |
+ |