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

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

Issue 2412023002: DevTools: migrate InspectorView to tabbed view location. (Closed)
Patch Set: test fixed 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 this._contentElement = this.contentElement.createChild("div", "tabbed-pane-c ontent"); 48 this._contentElement = this.contentElement.createChild("div", "tabbed-pane-c ontent");
49 this._contentElement.setAttribute("role", "tabpanel"); 49 this._contentElement.setAttribute("role", "tabpanel");
50 this._contentElement.createChild("content"); 50 this._contentElement.createChild("content");
51 /** @type {!Array.<!WebInspector.TabbedPaneTab>} */ 51 /** @type {!Array.<!WebInspector.TabbedPaneTab>} */
52 this._tabs = []; 52 this._tabs = [];
53 /** @type {!Array.<!WebInspector.TabbedPaneTab>} */ 53 /** @type {!Array.<!WebInspector.TabbedPaneTab>} */
54 this._tabsHistory = []; 54 this._tabsHistory = [];
55 /** @type {!Object.<string, !WebInspector.TabbedPaneTab>} */ 55 /** @type {!Object.<string, !WebInspector.TabbedPaneTab>} */
56 this._tabsById = {}; 56 this._tabsById = {};
57 this._currentTabLocked = false; 57 this._currentTabLocked = false;
58 this._autoSelectFirstItemOnShow = true;
58 59
59 this._dropDownButton = this._createDropDownButton(); 60 this._dropDownButton = this._createDropDownButton();
60 WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.Zo omChanged, this._zoomChanged, this); 61 WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.Zo omChanged, this._zoomChanged, this);
61 } 62 }
62 63
63 /** @enum {symbol} */ 64 /** @enum {symbol} */
64 WebInspector.TabbedPane.Events = { 65 WebInspector.TabbedPane.Events = {
65 TabSelected: Symbol("TabSelected"), 66 TabSelected: Symbol("TabSelected"),
66 TabClosed: Symbol("TabClosed"), 67 TabClosed: Symbol("TabClosed"),
67 TabOrderChanged: Symbol("TabOrderChanged") 68 TabOrderChanged: Symbol("TabOrderChanged")
68 } 69 }
69 70
70 WebInspector.TabbedPane.prototype = { 71 WebInspector.TabbedPane.prototype = {
71 /** 72 /**
72 * @param {boolean} locked 73 * @param {boolean} locked
73 */ 74 */
74 setCurrentTabLocked: function(locked) 75 setCurrentTabLocked: function(locked)
75 { 76 {
76 this._currentTabLocked = locked; 77 this._currentTabLocked = locked;
77 this._headerElement.classList.toggle("locked", this._currentTabLocked); 78 this._headerElement.classList.toggle("locked", this._currentTabLocked);
78 }, 79 },
79 80
80 /** 81 /**
82 * @param {boolean} autoSelect
83 */
84 setAutoSelectFirstItemOnShow: function(autoSelect)
85 {
86 this._autoSelectFirstItemOnShow = autoSelect;
87 },
88
89 /**
81 * @return {?WebInspector.Widget} 90 * @return {?WebInspector.Widget}
82 */ 91 */
83 get visibleView() 92 get visibleView()
84 { 93 {
85 return this._currentTab ? this._currentTab.view : null; 94 return this._currentTab ? this._currentTab.view : null;
86 }, 95 },
87 96
88 /** 97 /**
89 * @return {!Array.<string>} 98 * @return {!Array.<string>}
90 */ 99 */
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 }, 468 },
460 469
461 headerResized: function() 470 headerResized: function()
462 { 471 {
463 this._updateTabElements(); 472 this._updateTabElements();
464 }, 473 },
465 474
466 wasShown: function() 475 wasShown: function()
467 { 476 {
468 var effectiveTab = this._currentTab || this._tabsHistory[0]; 477 var effectiveTab = this._currentTab || this._tabsHistory[0];
469 if (effectiveTab) 478 if (effectiveTab && this._autoSelectFirstItemOnShow)
470 this.selectTab(effectiveTab.id); 479 this.selectTab(effectiveTab.id);
471 }, 480 },
472 481
473 /** 482 /**
474 * @param {boolean} enable 483 * @param {boolean} enable
475 */ 484 */
476 setTabSlider: function(enable) 485 setTabSlider: function(enable)
477 { 486 {
478 this._sliderEnabled = enable; 487 this._sliderEnabled = enable;
479 this._tabSlider.classList.toggle("enabled", enable); 488 this._tabSlider.classList.toggle("enabled", enable);
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 * @param {!Array.<string>} ids 1272 * @param {!Array.<string>} ids
1264 */ 1273 */
1265 closeTabs: function(tabbedPane, ids) { }, 1274 closeTabs: function(tabbedPane, ids) { },
1266 1275
1267 /** 1276 /**
1268 * @param {string} tabId 1277 * @param {string} tabId
1269 * @param {!WebInspector.ContextMenu} contextMenu 1278 * @param {!WebInspector.ContextMenu} contextMenu
1270 */ 1279 */
1271 onContextMenu: function(tabId, contextMenu) { } 1280 onContextMenu: function(tabId, contextMenu) { }
1272 } 1281 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698