Index: third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js |
index 1736ddc220bfff57deb3b6a4b1320226d6b179fc..13db19a9cb4232de4c69aa65085ea0ed43863765 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js |
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js |
@@ -26,12 +26,8 @@ Sources.SourcesView = class extends UI.VBox { |
/** @type {!Map.<!Workspace.UISourceCode, !UI.Widget>} */ |
this._sourceViewByUISourceCode = new Map(); |
- var tabbedEditorPlaceholderText = |
- Host.isMac() ? Common.UIString('Hit \u2318+P to open a file') : Common.UIString('Hit Ctrl+P to open a file'); |
- if (Runtime.experiments.isEnabled('persistence2')) |
- tabbedEditorPlaceholderText += '\n\n' + Common.UIString('Drop in a folder to add to workspace'); |
this._editorContainer = new Sources.TabbedEditorContainer( |
- this, Common.settings.createLocalSetting('previouslyViewedFiles', []), tabbedEditorPlaceholderText); |
+ this, Common.settings.createLocalSetting('previouslyViewedFiles', []), this._placeholderElement()); |
this._editorContainer.show(this._searchableView.element); |
this._editorContainer.addEventListener( |
Sources.TabbedEditorContainer.Events.EditorSelected, this._editorSelected, this); |
@@ -95,6 +91,28 @@ Sources.SourcesView = class extends UI.VBox { |
} |
/** |
+ * @return {!Element} |
+ */ |
+ _placeholderElement() { |
+ var shortcuts = [ |
+ {actionId: 'quickOpen.show', description: Common.UIString('Open file')}, |
+ {actionId: 'commandMenu.show', description: Common.UIString('Run command')} |
+ ]; |
+ |
+ var element = createElementWithClass('span', 'tabbed-pane-placeholder'); |
+ for (var shortcut of shortcuts) { |
+ var shortcutKeyText = UI.shortcutRegistry.shortcutTitleForAction(shortcut.actionId); |
+ var row = element.createChild('div', 'tabbed-pane-placeholder-row'); |
+ row.createChild('div', 'tabbed-pane-placeholder-key').textContent = shortcutKeyText; |
+ row.createChild('div', 'tabbed-pane-placeholder-value').textContent = shortcut.description; |
+ } |
+ if (Runtime.experiments.isEnabled('persistence2')) |
+ element.createChild('div').textContent = Common.UIString('Drop in a folder to add to workspace'); |
+ |
+ return element; |
+ } |
+ |
+ /** |
* @return {!Map.<!Workspace.UISourceCode, number>} |
*/ |
static defaultUISourceCodeScores() { |