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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js

Issue 2377193004: [DevTools] Rework some focus code. (Closed)
Patch Set: FocusRestorer Created 4 years, 2 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 }, 146 },
147 147
148 /** 148 /**
149 * @param {boolean} closeableTabs 149 * @param {boolean} closeableTabs
150 */ 150 */
151 setCloseableTabs: function(closeableTabs) 151 setCloseableTabs: function(closeableTabs)
152 { 152 {
153 this._closeableTabs = closeableTabs; 153 this._closeableTabs = closeableTabs;
154 }, 154 },
155 155
156 /**
157 * @override
158 */
156 focus: function() 159 focus: function()
157 { 160 {
158 if (this.visibleView) 161 if (this.visibleView)
159 this.visibleView.focus(); 162 this.visibleView.focus();
160 else 163 else
161 this.contentElement.focus(); 164 this.contentElement.focus();
162 }, 165 },
163 166
164 /** 167 /**
165 * @return {!Element} 168 * @return {!Element}
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 /** 428 /**
426 * @param {string} id 429 * @param {string} id
427 * @param {!WebInspector.Widget} view 430 * @param {!WebInspector.Widget} view
428 */ 431 */
429 changeTabView: function(id, view) 432 changeTabView: function(id, view)
430 { 433 {
431 var tab = this._tabsById[id]; 434 var tab = this._tabsById[id];
432 if (tab.view === view) 435 if (tab.view === view)
433 return; 436 return;
434 437
435 var shouldFocus = tab.view.element.isSelfOrAncestor(WebInspector.current FocusElement()); 438 var shouldFocus = tab.view.hasFocus();
436 439
437 this.suspendInvalidations(); 440 this.suspendInvalidations();
438 441
439 var isSelected = this._currentTab && this._currentTab.id === id; 442 var isSelected = this._currentTab && this._currentTab.id === id;
440 if (isSelected) 443 if (isSelected)
441 this._hideTab(tab); 444 this._hideTab(tab);
442 tab.view.detach(); 445 tab.view.detach();
443 tab.view = view; 446 tab.view = view;
444 tab.view.attach(this); 447 tab.view.attach(this);
445 if (isSelected) 448 if (isSelected)
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 * @param {!Array.<string>} ids 1263 * @param {!Array.<string>} ids
1261 */ 1264 */
1262 closeTabs: function(tabbedPane, ids) { }, 1265 closeTabs: function(tabbedPane, ids) { },
1263 1266
1264 /** 1267 /**
1265 * @param {string} tabId 1268 * @param {string} tabId
1266 * @param {!WebInspector.ContextMenu} contextMenu 1269 * @param {!WebInspector.ContextMenu} contextMenu
1267 */ 1270 */
1268 onContextMenu: function(tabId, contextMenu) { } 1271 onContextMenu: function(tabId, contextMenu) { }
1269 } 1272 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698