blob: 95cdbb76c30cf5edc16523c4466e821c5632489f [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright 2016 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.
-->
<link rel="import" href="/tracing/ui/base/tab_view.html">
<link rel="import" href="/tracing/ui/brushing_state_controller.html">
<link rel="import" href="/tracing/value/ui/value_set_table.html">
<dom-module id="tr-v-ui-value-set-view">
<template>
<style>
:host {
font-family: sans-serif;
};
</style>
<tr-v-ui-value-set-table id="valueSetTable"></tr-v-ui-value-set-table>
</template>
</dom-module>
<script>
'use strict';
tr.exportTo('tr.v.ui', function() {
function NullBrushingStateController() {
this.parentController = undefined;
}
NullBrushingStateController.prototype = {
__proto__: tr.c.BrushingStateController.prototype,
dispatchChangeEvent_: function() {
if (this.parentController)
this.parentController.dispatchChangeEvent_();
},
get model() {
if (!this.parentController)
return undefined;
return this.parentController.model;
},
get trackView() {
if (!this.parentController)
return undefined;
return this.parentController.trackView;
},
get viewport() {
if (!this.parentController)
return undefined;
return this.parentController.viewport;
},
get historyEnabled() {
if (!this.parentController)
return undefined;
return this.parentController.historyEnabled;
},
set historyEnabled(historyEnabled) {
if (this.parentController)
this.parentController.historyEnabled = historyEnabled;
},
modelWillChange: function() {
if (this.parentController)
this.parentController.modelWillChange();
},
modelDidChange: function() {
if (this.parentController)
this.parentController.modelDidChange();
},
onUserInitiatedSelectionChange_: function() {
if (this.parentController)
this.parentController.onUserInitiatedSelectionChange_();
},
onPopState_: function(e) {
if (this.parentController)
this.parentController.onPopState_(e);
},
get selection() {
if (!this.parentController)
return undefined;
return this.parentController.selection;
},
get findMatches() {
if (!this.parentController)
return undefined;
return this.parentController.findMatches;
},
get selectionOfInterest() {
if (!this.parentController)
return undefined;
return this.parentController.selectionOfInterest;
},
get currentBrushingState() {
if (!this.parentController)
return undefined;
return this.parentController.currentBrushingState;
},
set currentBrushingState(newBrushingState) {
if (this.parentController)
this.parentController.currentBrushingState = newBrushingState;
},
addAllEventsMatchingFilterToSelectionAsTask: function(filter, selection) {
if (this.parentController) {
this.parentController.addAllEventsMatchingFilterToSelectionAsTask(
filter, selection);
}
},
findTextChangedTo: function(allPossibleMatches) {
if (this.parentController)
this.parentController.findTextChangedTo(allPossibleMatches);
},
findFocusChangedTo: function(currentFocus) {
if (this.parentController)
this.parentController.findFocusChangedTo(currentFocus);
},
findTextCleared: function() {
if (this.parentController)
this.parentController.findTextCleared();
},
uiStateFromString: function(string) {
if (this.parentController)
this.parentController.uiStateFromString(string);
},
navToPosition: function(uiState, showNavLine) {
if (this.parentController)
this.parentController.navToPosition(uiState, showNavLine);
},
changeSelectionFromTimeline: function(selection) {
if (this.parentController)
this.parentController.changeSelectionFromTimeline(selection);
},
showScriptControlSelection: function(selection) {
if (this.parentController)
this.parentController.showScriptControlSelection(selection);
},
changeSelectionFromRequestSelectionChangeEvent: function(selection) {
if (this.parentController) {
this.parentController.changeSelectionFromRequestSelectionChangeEvent(
selection);
}
},
changeAnalysisViewRelatedEvents: function(eventSet) {
if (this.parentController && (eventSet instanceof tr.model.EventSet))
this.parentController.changeAnalysisViewRelatedEvents(eventSet);
},
changeAnalysisLinkHoveredEvents: function(eventSet) {
if (this.parentController && (eventSet instanceof tr.model.EventSet))
this.parentController.changeAnalysisLinkHoveredEvents(eventSet);
},
getViewSpecificBrushingState: function(viewId) {
if (this.parentController)
this.parentController.getViewSpecificBrushingState(viewId);
},
changeViewSpecificBrushingState: function(viewId, newState) {
if (this.parentController)
this.parentController.changeViewSpecificBrushingState(viewId, newState);
}
};
Polymer({
is: 'tr-v-ui-value-set-view',
ready: function() {
this.brushingStateController = new NullBrushingStateController();
},
attached: function() {
this.brushingStateController.parentController =
tr.c.BrushingStateController.getControllerForElement(this.parentNode);
},
/**
* @param {!tr.v.ValueSet} values
*/
set values(values) {
this.$.valueSetTable.values = values;
}
});
return {};
});
</script>