| OLD | NEW |
| 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 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 }, | 1140 }, |
| 1141 | 1141 |
| 1142 /** | 1142 /** |
| 1143 * @param {string} id | 1143 * @param {string} id |
| 1144 * @param {string} title | 1144 * @param {string} title |
| 1145 * @param {!WebInspector.Setting} setting | 1145 * @param {!WebInspector.Setting} setting |
| 1146 */ | 1146 */ |
| 1147 _toggleSettingBasedView: function(id, title, setting) | 1147 _toggleSettingBasedView: function(id, title, setting) |
| 1148 { | 1148 { |
| 1149 this._tabbedPane.closeTab(id); | 1149 this._tabbedPane.closeTab(id); |
| 1150 if (setting.get()) | 1150 if (setting.get()) { |
| 1151 this._tabbedPane.appendTab(id, title, new WebInspector.View()); | 1151 this._tabbedPane.appendTab(id, title, new WebInspector.View()); |
| 1152 this._tabbedPane.selectTab(id); |
| 1153 } |
| 1152 }, | 1154 }, |
| 1153 | 1155 |
| 1154 /** | 1156 /** |
| 1155 * @param {!WebInspector.Event} event | 1157 * @param {!WebInspector.Event} event |
| 1156 */ | 1158 */ |
| 1157 _tabSelected: function(event) | 1159 _tabSelected: function(event) |
| 1158 { | 1160 { |
| 1159 var tabId = this._tabbedPane.selectedTabId; | 1161 var tabId = this._tabbedPane.selectedTabId; |
| 1160 if (!tabId) | 1162 if (!tabId) |
| 1161 return; | 1163 return; |
| 1162 var view = this._viewForId(tabId); | 1164 var view = this._viewForId(tabId); |
| 1163 if (view) | 1165 if (view) |
| 1164 this._tabbedPane.changeTabView(tabId, view); | 1166 this._tabbedPane.changeTabView(tabId, view); |
| 1165 }, | 1167 }, |
| 1166 | 1168 |
| 1167 /** | 1169 /** |
| 1168 * @return {?WebInspector.View} | 1170 * @return {?WebInspector.View} |
| 1169 */ | 1171 */ |
| 1170 _viewForId: function(id) | 1172 _viewForId: function(id) |
| 1171 { | 1173 { |
| 1172 if (this._views.contains(id)) | 1174 if (this._views.contains(id)) |
| 1173 return /** @type {!WebInspector.View} */ (this._views.get(id)); | 1175 return /** @type {!WebInspector.View} */ (this._views.get(id)); |
| 1174 var view = this._extensions[id] ? /** @type {!WebInspector.View} */ (thi
s._extensions[id].instance()) : null; | 1176 var view = this._extensions[id] ? /** @type {!WebInspector.View} */ (thi
s._extensions[id].instance()) : null; |
| 1175 this._views.put(id, view); | 1177 this._views.put(id, view); |
| 1176 if (this._viewCallback && view) | 1178 if (this._viewCallback && view) |
| 1177 this._viewCallback(id, view); | 1179 this._viewCallback(id, view); |
| 1178 return view; | 1180 return view; |
| 1179 } | 1181 } |
| 1180 } | 1182 } |
| OLD | NEW |