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

Side by Side Diff: tracing/tracing/value/ui/histogram_set_view_state.html

Issue 2747453003: Refactor histogram-set-view to an MVC pattern. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2017 The Chromium Authors. All rights reserved. 3 Copyright 2017 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/base/view_state.html"> 8 <link rel="import" href="/tracing/base/view_state.html">
9 9
10 <script> 10 <script>
11 'use strict'; 11 'use strict';
12 tr.exportTo('tr.v.ui', function() { 12 tr.exportTo('tr.v.ui', function() {
13 class HistogramSetViewState extends tr.b.ViewState { 13 class HistogramSetViewState extends tr.b.ViewState {
14 constructor() { 14 constructor() {
15 super(); 15 super();
16 this.define('searchQuery', ''); 16 this.define('searchQuery', '');
17 this.define('referenceDisplayLabel', ''); 17 this.define('referenceDisplayLabel', '');
18 this.define('displayStatisticName', ''); 18 this.define('displayStatisticName', '');
19 this.define('showAll', false); 19 this.define('showAll', false);
20 this.define('groupings', []); 20 this.define('groupings', []);
21 this.define('sortColumnIndex', 0); 21 this.define('sortColumnIndex', 0);
22 this.define('sortDescending', false); 22 this.define('sortDescending', false);
23 this.define('constrainNameColumn', true); 23 this.define('constrainNameColumn', true);
24 this.define('tableRowStates', []); 24 this.define('tableRowStates', new Map());
25 } 25 }
26 } 26 }
27 27
28 tr.b.ViewState.register(HistogramSetViewState); 28 tr.b.ViewState.register(HistogramSetViewState);
29 29
30 class HistogramSetTableRowState extends tr.b.ViewState { 30 class HistogramSetTableRowState extends tr.b.ViewState {
31 constructor() { 31 constructor() {
32 super(); 32 super();
33 this.define('isExpanded', false); 33 this.define('isExpanded', false);
34 this.define('isOverviewed', false); 34 this.define('isOverviewed', false);
35 this.define('cells', new Map()); 35 this.define('cells', new Map());
36 this.define('subRows', []); 36 this.define('subRows', new Map());
37 } 37 }
38 38
39 * walk() { 39 * walk() {
40 yield this; 40 yield this;
41 for (const row of this.subRows) yield* row.walk(); 41 for (const row of this.subRows.values()) yield* row.walk();
42 } 42 }
43 43
44 static* walkAll(rootRows) { 44 static* walkAll(rootRows) {
45 for (const rootRow of rootRows) yield* rootRow.walk(); 45 for (const rootRow of rootRows) yield* rootRow.walk();
46 } 46 }
47 } 47 }
48 48
49 tr.b.ViewState.register(HistogramSetTableRowState); 49 tr.b.ViewState.register(HistogramSetTableRowState);
50 50
51 class HistogramSetTableCellState extends tr.b.ViewState { 51 class HistogramSetTableCellState extends tr.b.ViewState {
52 constructor() { 52 constructor() {
53 super(); 53 super();
54 this.define('isOpen', false); 54 this.define('isOpen', false);
55 this.define('brushedBinRange', new tr.b.math.Range()); 55 this.define('brushedBinRange', new tr.b.math.Range());
56 this.define('mergeSampleDiagnostics', true); 56 this.define('mergeSampleDiagnostics', true);
57 } 57 }
58 } 58 }
59 59
60 tr.b.ViewState.register(HistogramSetTableCellState); 60 tr.b.ViewState.register(HistogramSetTableCellState);
61 61
62 return { 62 return {
63 HistogramSetTableCellState, 63 HistogramSetTableCellState,
64 HistogramSetTableRowState, 64 HistogramSetTableRowState,
65 HistogramSetViewState, 65 HistogramSetViewState,
66 }; 66 };
67 }); 67 });
68 </script> 68 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/value/ui/histogram_set_view.html ('k') | tracing/tracing/value/ui/histogram_set_view_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698