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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js

Issue 2319523004: DevTools: Remember the last focused widget. (Closed)
Patch Set: Fix stray braces Created 4 years, 3 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 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google 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 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 navigatorMenuButton.setTitle(WebInspector.UIString("More options")); 74 navigatorMenuButton.setTitle(WebInspector.UIString("More options"));
75 navigatorToolbar.appendToolbarItem(navigatorMenuButton); 75 navigatorToolbar.appendToolbarItem(navigatorMenuButton);
76 tabbedPane.appendAfterTabStrip(navigatorToolbar.element); 76 tabbedPane.appendAfterTabStrip(navigatorToolbar.element);
77 this.editorView.setSidebarWidget(tabbedPane); 77 this.editorView.setSidebarWidget(tabbedPane);
78 78
79 this._sourcesView = new WebInspector.SourcesView(); 79 this._sourcesView = new WebInspector.SourcesView();
80 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSel ected, this._editorSelected.bind(this)); 80 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSel ected, this._editorSelected.bind(this));
81 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClo sed, this._editorClosed.bind(this)); 81 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClo sed, this._editorClosed.bind(this));
82 this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this)); 82 this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this));
83 this.editorView.setMainWidget(this._sourcesView); 83 this.editorView.setMainWidget(this._sourcesView);
84 this._sourcesView.makeDefaultFocused();
84 this._editorChanged(this._sourcesView.currentUISourceCode()); 85 this._editorChanged(this._sourcesView.currentUISourceCode());
85 86
86 this._threadsSidebarPane = null; 87 this._threadsSidebarPane = null;
87 this._watchSidebarPane = /** @type {!WebInspector.View} */ (WebInspector.vie wManager.view("sources.watch")); 88 this._watchSidebarPane = /** @type {!WebInspector.View} */ (WebInspector.vie wManager.view("sources.watch"));
88 // TODO: Force installing listeners from the model, not the UI. 89 // TODO: Force installing listeners from the model, not the UI.
89 self.runtime.sharedInstance(WebInspector.XHRBreakpointsSidebarPane); 90 self.runtime.sharedInstance(WebInspector.XHRBreakpointsSidebarPane);
90 this._callstackPane = self.runtime.sharedInstance(WebInspector.CallStackSide barPane); 91 this._callstackPane = self.runtime.sharedInstance(WebInspector.CallStackSide barPane);
91 this._callstackPane.registerShortcuts(this.registerShortcuts.bind(this)); 92 this._callstackPane.registerShortcuts(this.registerShortcuts.bind(this));
92 93
93 this._installDebuggerSidebarController(); 94 this._installDebuggerSidebarController();
(...skipping 21 matching lines...) Expand all
115 WebInspector.targetManager.observeTargets(this); 116 WebInspector.targetManager.observeTargets(this);
116 } 117 }
117 118
118 WebInspector.SourcesPanel._lastModificationTimeout = 200; 119 WebInspector.SourcesPanel._lastModificationTimeout = 200;
119 120
120 WebInspector.SourcesPanel.minToolbarWidth = 215; 121 WebInspector.SourcesPanel.minToolbarWidth = 215;
121 122
122 WebInspector.SourcesPanel.prototype = { 123 WebInspector.SourcesPanel.prototype = {
123 /** 124 /**
124 * @override 125 * @override
125 */
126 focus: function()
127 {
128 this._sourcesView.focus();
pfeldman 2016/09/08 00:53:50 Did we only have one?
einbinder 2016/09/09 01:32:16 For now. There are some places where we don't set
129 },
130
131 /**
132 * @override
133 * @param {!WebInspector.Target} target 126 * @param {!WebInspector.Target} target
134 */ 127 */
135 targetAdded: function(target) 128 targetAdded: function(target)
136 { 129 {
137 var hasThreads = WebInspector.targetManager.targets(WebInspector.Target. Capability.JS).length > 1; 130 var hasThreads = WebInspector.targetManager.targets(WebInspector.Target. Capability.JS).length > 1;
138 if (hasThreads && !this._threadsSidebarPane) { 131 if (hasThreads && !this._threadsSidebarPane) {
139 this._threadsSidebarPane = /** @type {!WebInspector.View} */ (WebIns pector.viewManager.view("sources.threads")); 132 this._threadsSidebarPane = /** @type {!WebInspector.View} */ (WebIns pector.viewManager.view("sources.threads"));
140 if (this._sidebarPaneStack) { 133 if (this._sidebarPaneStack) {
141 this._sidebarPaneStack.showView(this._threadsSidebarPane, this._ splitWidget.isVertical() ? this._watchSidebarPane : this._callstackPane); 134 this._sidebarPaneStack.showView(this._threadsSidebarPane, this._ splitWidget.isVertical() ? this._watchSidebarPane : this._callstackPane);
142 } 135 }
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 __proto__: WebInspector.VBox.prototype 1368 __proto__: WebInspector.VBox.prototype
1376 } 1369 }
1377 1370
1378 /** 1371 /**
1379 * @return {boolean} 1372 * @return {boolean}
1380 */ 1373 */
1381 WebInspector.SourcesPanel.WrapperView.isShowing = function() 1374 WebInspector.SourcesPanel.WrapperView.isShowing = function()
1382 { 1375 {
1383 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing(); 1376 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing();
1384 } 1377 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698