Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / cc / layer_view.html
index 4f9b613..2c15882 100644 (file)
@@ -37,6 +37,8 @@ tvcm.exportTo('cc', function() {
       this.layerTreeQuadStackView_ = new cc.LayerTreeQuadStackView();
       this.dragBar_ = new tvcm.ui.DragHandle();
       this.analysisEl_ = document.createElement('layer-view-analysis');
+      this.analysisEl_.addEventListener('requestSelectionChange',
+          this.onRequestSelectionChangeFromAnalysisEl_.bind(this));
 
       this.dragBar_.target = this.analysisEl_;
 
@@ -44,7 +46,7 @@ tvcm.exportTo('cc', function() {
       this.appendChild(this.dragBar_);
       this.appendChild(this.analysisEl_);
 
-      this.layerTreeQuadStackView_.addEventListener('selectionChange',
+      this.layerTreeQuadStackView_.addEventListener('selection-change',
           function() {
             this.layerTreeQuadStackViewSelectionChanged_();
           }.bind(this));
@@ -99,6 +101,7 @@ tvcm.exportTo('cc', function() {
         this.layerTreeQuadStackView_.style.height =
             window.getComputedStyle(this).height;
       }
+      tvcm.dispatchSimpleEvent(this, 'selection-change');
     },
 
     createPictureBtn_: function(pictures) {
@@ -117,6 +120,23 @@ tvcm.exportTo('cc', function() {
         return selection;
       };
       return link;
+    },
+
+    onRequestSelectionChangeFromAnalysisEl_: function(e) {
+      if (!(e.selection instanceof cc.Selection))
+        return;
+
+      e.stopPropagation();
+      this.selection = e.selection;
+    },
+
+    get extraHighlightsByLayerId() {
+      return this.layerTreeQuadStackView_.extraHighlightsByLayerId;
+    },
+
+    set extraHighlightsByLayerId(extraHighlightsByLayerId) {
+      this.layerTreeQuadStackView_.extraHighlightsByLayerId =
+          extraHighlightsByLayerId;
     }
   };