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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/EventsTimelineTreeView.js

Issue 2678623002: DevTools: pass title when creating settings (Closed)
Patch Set: rebase Created 3 years, 10 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @unrestricted 6 * @unrestricted
7 */ 7 */
8 Timeline.EventsTimelineTreeView = class extends Timeline.TimelineTreeView { 8 Timeline.EventsTimelineTreeView = class extends Timeline.TimelineTreeView {
9 /** 9 /**
10 * @param {!Array<!TimelineModel.TimelineModelFilter>} filters 10 * @param {!Array<!TimelineModel.TimelineModelFilter>} filters
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 155
156 /** 156 /**
157 * @param {!UI.Toolbar} toolbar 157 * @param {!UI.Toolbar} toolbar
158 */ 158 */
159 populateToolbar(toolbar) { 159 populateToolbar(toolbar) {
160 var durationFilterUI = new UI.ToolbarComboBox(durationFilterChanged.bind(thi s)); 160 var durationFilterUI = new UI.ToolbarComboBox(durationFilterChanged.bind(thi s));
161 for (var durationMs of Timeline.EventsTimelineTreeView.Filters._durationFilt erPresetsMs) { 161 for (var durationMs of Timeline.EventsTimelineTreeView.Filters._durationFilt erPresetsMs) {
162 durationFilterUI.addOption(durationFilterUI.createOption( 162 durationFilterUI.addOption(durationFilterUI.createOption(
163 durationMs ? Common.UIString('\u2265 %d\u2009ms', durationMs) : Common .UIString('All'), 163 durationMs ? Common.UIString('\u2265 %d\u2009ms', durationMs) : Common .UIString('All'),
164 durationMs ? Common.UIString('Hide records shorter than %d\u2009ms', d urationMs) 164 durationMs ? Common.UIString('Hide records shorter than %d\u2009ms', d urationMs) :
165 : Common.UIString('Show all records'), 165 Common.UIString('Show all records'),
luoe 2017/02/13 06:27:20 clang format insisted on this
166 String(durationMs))); 166 String(durationMs)));
167 } 167 }
168 toolbar.appendToolbarItem(durationFilterUI); 168 toolbar.appendToolbarItem(durationFilterUI);
169 169
170 var categoryFiltersUI = {}; 170 var categoryFiltersUI = {};
171 var categories = Timeline.TimelineUIUtils.categories(); 171 var categories = Timeline.TimelineUIUtils.categories();
172 for (var categoryName in categories) { 172 for (var categoryName in categories) {
173 var category = categories[categoryName]; 173 var category = categories[categoryName];
174 if (!category.visible) 174 if (!category.visible)
175 continue; 175 continue;
176 var checkbox = new UI.ToolbarCheckbox( 176 var checkbox =
177 category.title, undefined, undefined, categoriesFilterChanged.bind(thi s, categoryName)); 177 new UI.ToolbarCheckbox(category.title, undefined, categoriesFilterChan ged.bind(this, categoryName));
178 checkbox.setChecked(true); 178 checkbox.setChecked(true);
179 checkbox.inputElement.style.backgroundColor = category.color; 179 checkbox.inputElement.style.backgroundColor = category.color;
180 categoryFiltersUI[category.name] = checkbox; 180 categoryFiltersUI[category.name] = checkbox;
181 toolbar.appendToolbarItem(checkbox); 181 toolbar.appendToolbarItem(checkbox);
182 } 182 }
183 183
184 /** 184 /**
185 * @this {Timeline.EventsTimelineTreeView.Filters} 185 * @this {Timeline.EventsTimelineTreeView.Filters}
186 */ 186 */
187 function durationFilterChanged() { 187 function durationFilterChanged() {
(...skipping 18 matching lines...) Expand all
206 this.dispatchEventToListeners(Timeline.EventsTimelineTreeView.Filters.Events .FilterChanged); 206 this.dispatchEventToListeners(Timeline.EventsTimelineTreeView.Filters.Events .FilterChanged);
207 } 207 }
208 }; 208 };
209 209
210 Timeline.EventsTimelineTreeView.Filters._durationFilterPresetsMs = [0, 1, 15]; 210 Timeline.EventsTimelineTreeView.Filters._durationFilterPresetsMs = [0, 1, 15];
211 211
212 /** @enum {symbol} */ 212 /** @enum {symbol} */
213 Timeline.EventsTimelineTreeView.Filters.Events = { 213 Timeline.EventsTimelineTreeView.Filters.Events = {
214 FilterChanged: Symbol('FilterChanged') 214 FilterChanged: Symbol('FilterChanged')
215 }; 215 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698