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

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

Issue 2584783002: DevTools: Add "New" button to launch timeline landing page. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/toolbar.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 286 }
287 287
288 _recreateToolbarItems() { 288 _recreateToolbarItems() {
289 this._panelToolbar.removeToolbarItems(); 289 this._panelToolbar.removeToolbarItems();
290 290
291 const perspectiveSetting = 291 const perspectiveSetting =
292 Common.settings.createSetting('timelinePerspective', Timeline.TimelinePa nel.Perspectives.Load); 292 Common.settings.createSetting('timelinePerspective', Timeline.TimelinePa nel.Perspectives.Load);
293 293
294 // Record 294 // Record
295 if (Runtime.experiments.isEnabled('timelineLandingPage')) { 295 if (Runtime.experiments.isEnabled('timelineLandingPage')) {
296 const newButton = new UI.ToolbarButton(
297 Common.UIString('New recording'), 'largeicon-add', Common.UIString('Ne w'));
298 newButton.addEventListener(UI.ToolbarButton.Events.Click, this._clear, thi s);
299 this._panelToolbar.appendToolbarItem(newButton);
296 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._t oggleRecordAction)); 300 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._t oggleRecordAction));
297 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButtonForId('m ain.reload')); 301 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButtonForId('m ain.reload'));
298 } else if (Runtime.experiments.isEnabled('timelineRecordingPerspectives') && 302 } else if (Runtime.experiments.isEnabled('timelineRecordingPerspectives') &&
299 perspectiveSetting.get() === Timeline.TimelinePanel.Perspectives.Load) { 303 perspectiveSetting.get() === Timeline.TimelinePanel.Perspectives.Load) {
300 const reloadButton = new UI.ToolbarButton(Common.UIString('Record & Reload '), 'largeicon-refresh'); 304 const reloadButton = new UI.ToolbarButton(Common.UIString('Record & Reload '), 'largeicon-refresh');
301 reloadButton.addEventListener(UI.ToolbarButton.Events.Click, () => SDK.tar getManager.reloadPage()); 305 reloadButton.addEventListener(UI.ToolbarButton.Events.Click, () => SDK.tar getManager.reloadPage());
302 this._panelToolbar.appendToolbarItem(reloadButton); 306 this._panelToolbar.appendToolbarItem(reloadButton);
303 } else { 307 } else {
304 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._t oggleRecordAction)); 308 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._t oggleRecordAction));
305 } 309 }
306 310
307 // Clear 311 // Clear
308 var clearButton = new UI.ToolbarButton(Common.UIString('Clear recording'), ' largeicon-clear'); 312 if (!Runtime.experiments.isEnabled('timelineLandingPage')) {
309 clearButton.addEventListener(UI.ToolbarButton.Events.Click, this._clear, thi s); 313 const clearButton = new UI.ToolbarButton(Common.UIString('Clear recording' ), 'largeicon-clear');
310 this._panelToolbar.appendToolbarItem(clearButton); 314 clearButton.addEventListener(UI.ToolbarButton.Events.Click, this._clear, t his);
315 this._panelToolbar.appendToolbarItem(clearButton);
316 }
311 317
312 this._panelToolbar.appendSeparator(); 318 this._panelToolbar.appendSeparator();
313 319
314 // Combo 320 // Combo
315 if (!Runtime.experiments.isEnabled('timelineLandingPage') && 321 if (!Runtime.experiments.isEnabled('timelineLandingPage') &&
316 Runtime.experiments.isEnabled('timelineRecordingPerspectives')) { 322 Runtime.experiments.isEnabled('timelineRecordingPerspectives')) {
317 /** 323 /**
318 * @this {!Timeline.TimelinePanel} 324 * @this {!Timeline.TimelinePanel}
319 */ 325 */
320 function onPerspectiveChanged() { 326 function onPerspectiveChanged() {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 this._captureLayersAndPicturesSetting.set(false); 370 this._captureLayersAndPicturesSetting.set(false);
365 this._captureFilmStripSetting.set(false); 371 this._captureFilmStripSetting.set(false);
366 this._detailsView.selectTab(Timeline.TimelinePanel.DetailsTab.BottomUp , false); 372 this._detailsView.selectTab(Timeline.TimelinePanel.DetailsTab.BottomUp , false);
367 break; 373 break;
368 } 374 }
369 375
370 this._bulkUpdate = false; 376 this._bulkUpdate = false;
371 this._onModeChanged(); 377 this._onModeChanged();
372 } 378 }
373 379
380 // Checkboxes
374 if (Runtime.experiments.isEnabled('timelineLandingPage')) { 381 if (Runtime.experiments.isEnabled('timelineLandingPage')) {
375 if (!this._model.isEmpty()) { 382 if (!this._model.isEmpty()) {
376 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox(Common. UIString('Memory'), 383 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox(Common. UIString('Memory'),
377 this._showMemorySetting, Common.UIString('Show memory timeline.'))); 384 this._showMemorySetting, Common.UIString('Show memory timeline.')));
378 if (this._filmStripModel.frames().length) { 385 if (this._filmStripModel.frames().length) {
379 this._showScreenshotsSetting.set(true); 386 this._showScreenshotsSetting.set(true);
380 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox(Commo n.UIString('Screenshots'), 387 this._panelToolbar.appendToolbarItem(this._createSettingCheckbox(Commo n.UIString('Screenshots'),
381 this._showScreenshotsSetting, Common.UIString('Show captured scree nshots.'))); 388 this._showScreenshotsSetting, Common.UIString('Show captured scree nshots.')));
382 } 389 }
383 } 390 }
(...skipping 30 matching lines...) Expand all
414 421
415 const traceProviders = Extensions.extensionServer.traceProviders(); 422 const traceProviders = Extensions.extensionServer.traceProviders();
416 if (traceProviders.length) { 423 if (traceProviders.length) {
417 this._panelToolbar.appendSeparator(); 424 this._panelToolbar.appendSeparator();
418 for (let provider of traceProviders) { 425 for (let provider of traceProviders) {
419 const setting = Timeline.TimelinePanel._settingForTraceProvider(provider ); 426 const setting = Timeline.TimelinePanel._settingForTraceProvider(provider );
420 const checkbox = this._createSettingCheckbox(provider.shortDisplayName() , setting, provider.longDisplayName()); 427 const checkbox = this._createSettingCheckbox(provider.shortDisplayName() , setting, provider.longDisplayName());
421 this._panelToolbar.appendToolbarItem(checkbox); 428 this._panelToolbar.appendToolbarItem(checkbox);
422 } 429 }
423 } 430 }
424 this._panelToolbar.appendSeparator();
425 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButtonForId('com ponents.collect-garbage'));
426 431
427 this._panelToolbar.appendSeparator(); 432 this._panelToolbar.appendSeparator();
428 this._cpuThrottlingCombobox = new UI.ToolbarComboBox(this._onCPUThrottlingCh anged.bind(this)); 433 this._cpuThrottlingCombobox = new UI.ToolbarComboBox(this._onCPUThrottlingCh anged.bind(this));
429 this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect()); 434 this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect());
430 this._panelToolbar.appendToolbarItem(this._cpuThrottlingCombobox); 435 this._panelToolbar.appendToolbarItem(this._cpuThrottlingCombobox);
431 this._populateCPUThrottingCombobox(); 436 this._populateCPUThrottingCombobox();
437
438 this._panelToolbar.appendSeparator();
439 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButtonForId('com ponents.collect-garbage'));
440
432 this._updateTimelineControls(); 441 this._updateTimelineControls();
433 } 442 }
434 443
435 /** 444 /**
436 * @param {!Extensions.ExtensionTraceProvider} traceProvider 445 * @param {!Extensions.ExtensionTraceProvider} traceProvider
437 * @return {!Common.Setting<boolean>} 446 * @return {!Common.Setting<boolean>}
438 */ 447 */
439 static _settingForTraceProvider(traceProvider) { 448 static _settingForTraceProvider(traceProvider) {
440 var setting = traceProvider[Timeline.TimelinePanel._traceProviderSettingSymb ol]; 449 var setting = traceProvider[Timeline.TimelinePanel._traceProviderSettingSymb ol];
441 if (!setting) { 450 if (!setting) {
(...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after
2086 } 2095 }
2087 2096
2088 /** 2097 /**
2089 * @override 2098 * @override
2090 * @param {!SDK.Target} target 2099 * @param {!SDK.Target} target
2091 */ 2100 */
2092 targetRemoved(target) { 2101 targetRemoved(target) {
2093 this._targets.remove(target, true); 2102 this._targets.remove(target, true);
2094 } 2103 }
2095 }; 2104 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/toolbar.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698