| OLD | NEW |
| 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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 */ | 638 */ |
| 639 function encloseWithTag(tagName, contents) { | 639 function encloseWithTag(tagName, contents) { |
| 640 var e = createElement(tagName); | 640 var e = createElement(tagName); |
| 641 e.textContent = contents; | 641 e.textContent = contents; |
| 642 return e; | 642 return e; |
| 643 } | 643 } |
| 644 | 644 |
| 645 var learnMoreNode = UI.createExternalLink( | 645 var learnMoreNode = UI.createExternalLink( |
| 646 'https://developers.google.com/web/tools/chrome-devtools/evaluate-perfor
mance/', | 646 'https://developers.google.com/web/tools/chrome-devtools/evaluate-perfor
mance/', |
| 647 Common.UIString('Learn\xa0more')); | 647 Common.UIString('Learn\xa0more')); |
| 648 var learnMoreMigrationNode = UI.createExternalLink( |
| 649 'https://developers.google.com/web/updates/2016/12/devtools-javascript-c
pu-profile-migration', |
| 650 Common.UIString('Learn\xa0more')); |
| 651 |
| 648 var recordKey = | 652 var recordKey = |
| 649 encloseWithTag('b', UI.shortcutRegistry.shortcutDescriptorsForAction('ti
meline.toggle-recording')[0].name); | 653 encloseWithTag('b', UI.shortcutRegistry.shortcutDescriptorsForAction('ti
meline.toggle-recording')[0].name); |
| 650 var reloadKey = encloseWithTag('b', UI.shortcutRegistry.shortcutDescriptorsF
orAction('main.reload')[0].name); | 654 var reloadKey = encloseWithTag('b', UI.shortcutRegistry.shortcutDescriptorsF
orAction('main.reload')[0].name); |
| 651 var navigateNode = encloseWithTag('b', Common.UIString('WASD')); | 655 var navigateNode = encloseWithTag('b', Common.UIString('WASD')); |
| 652 | 656 |
| 653 this._landingPage = new UI.VBox(); | 657 this._landingPage = new UI.VBox(); |
| 654 this._landingPage.contentElement.classList.add('timeline-landing-page', 'fil
l'); | 658 this._landingPage.contentElement.classList.add('timeline-landing-page', 'fil
l'); |
| 655 var centered = this._landingPage.contentElement.createChild('div'); | 659 var centered = this._landingPage.contentElement.createChild('div'); |
| 656 | 660 |
| 657 var recordButton = UI.Toolbar.createActionButton(this._toggleRecordAction).e
lement; | 661 var recordButton = UI.Toolbar.createActionButton(this._toggleRecordAction).e
lement; |
| 658 var reloadButton = UI.Toolbar.createActionButtonForId('main.reload').element
; | 662 var reloadButton = UI.Toolbar.createActionButtonForId('main.reload').element
; |
| 659 | 663 |
| 660 centered.createChild('p').appendChild(UI.formatLocalized( | 664 centered.createChild('p').appendChild(UI.formatLocalized( |
| 661 'Click the record button %s or hit %s to capture a new recording.\n' + | 665 'Click the record button %s or hit %s to capture a new recording.\n' + |
| 662 'Click the reload button %s or hit %s to record and evaluate the pag
e load.', | 666 'Click the reload button %s or hit %s to record and evaluate the page lo
ad.', |
| 663 [recordButton, recordKey, reloadButton, reloadKey])); | 667 [recordButton, recordKey, reloadButton, reloadKey])); |
| 664 | 668 |
| 665 centered.createChild('p').appendChild(UI.formatLocalized( | 669 centered.createChild('p').appendChild(UI.formatLocalized( |
| 666 'After recording, select an area of interest in the overview by dragging
.\n' + | 670 'After recording, select an area of interest in the overview by dragging
.\n' + |
| 667 'Then, zoom and pan the timeline with the mousewheel or %s keys.\n%s
', | 671 'Then, zoom and pan the timeline with the mousewheel or %s keys.\n%s', |
| 668 [navigateNode, learnMoreNode])); | 672 [navigateNode, learnMoreNode])); |
| 669 | 673 |
| 670 var cpuProfilerHintSetting = Common.settings.createSetting('timelineShowProf
ilerHint', true); | 674 var cpuProfilerHintSetting = Common.settings.createSetting('timelineShowProf
ilerHint', true); |
| 671 if (cpuProfilerHintSetting.get()) { | 675 if (cpuProfilerHintSetting.get()) { |
| 672 var warning = centered.createChild('p', 'timeline-landing-warning'); | 676 var warning = centered.createChild('p', 'timeline-landing-warning'); |
| 673 var closeButton = warning.createChild('div', 'timeline-landing-warning-clo
se', 'dt-close-button'); | 677 var closeButton = warning.createChild('div', 'timeline-landing-warning-clo
se', 'dt-close-button'); |
| 674 closeButton.addEventListener('click', () => { | 678 closeButton.addEventListener('click', () => { |
| 675 warning.style.visibility = 'hidden'; | 679 warning.style.visibility = 'hidden'; |
| 676 cpuProfilerHintSetting.set(false); | 680 cpuProfilerHintSetting.set(false); |
| 677 }, false); | 681 }, false); |
| 678 var performanceSpan = encloseWithTag('b', Common.UIString('Performance')); | 682 var performanceSpan = encloseWithTag('b', Common.UIString('Performance')); |
| 679 warning.createChild('div').appendChild(UI.formatLocalized( | 683 warning.createChild('div').appendChild(UI.formatLocalized( |
| 680 'The %s panel provides the combined functionality of Timeline and CPU
profiler.%s' + | 684 `The %s panel provides the combined functionality of Timeline and Java
Script CPU profiler. %s%s` + |
| 681 'The JavaScript CPU profiler will be removed shortly. Meanwhile, i
t\'s available under ' + | 685 `The JavaScript CPU profiler will be removed shortly. Meanwhile, it's
available under ` + |
| 682 '%s \u2192 More Tools \u2192 JavaScript Profiler.', | 686 `%s \u2192 More Tools \u2192 JavaScript Profiler.`, |
| 683 [performanceSpan, createElement('p'), UI.Icon.create('largeicon-menu')
])); | 687 [performanceSpan, learnMoreMigrationNode, createElement('p'), UI.Icon.
create('largeicon-menu')])); |
| 684 } | 688 } |
| 685 | 689 |
| 686 this._landingPage.show(this._statusPaneContainer); | 690 this._landingPage.show(this._statusPaneContainer); |
| 687 } | 691 } |
| 688 | 692 |
| 689 _hideLandingPage() { | 693 _hideLandingPage() { |
| 690 this._landingPage.detach(); | 694 this._landingPage.detach(); |
| 691 } | 695 } |
| 692 | 696 |
| 693 /** | 697 /** |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 return true; | 1292 return true; |
| 1289 case 'timeline.jump-to-next-frame': | 1293 case 'timeline.jump-to-next-frame': |
| 1290 panel._jumpToFrame(1); | 1294 panel._jumpToFrame(1); |
| 1291 return true; | 1295 return true; |
| 1292 } | 1296 } |
| 1293 return false; | 1297 return false; |
| 1294 } | 1298 } |
| 1295 }; | 1299 }; |
| 1296 | 1300 |
| 1297 Timeline.TimelinePanel._traceProviderSettingSymbol = Symbol('traceProviderSettin
g'); | 1301 Timeline.TimelinePanel._traceProviderSettingSymbol = Symbol('traceProviderSettin
g'); |
| OLD | NEW |