| OLD | NEW |
| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 this._setTarget(target); | 171 this._setTarget(target); |
| 172 }, | 172 }, |
| 173 /** | 173 /** |
| 174 * @return {boolean} | 174 * @return {boolean} |
| 175 */ | 175 */ |
| 176 paused: function() | 176 paused: function() |
| 177 { | 177 { |
| 178 return this._paused; | 178 return this._paused; |
| 179 }, | 179 }, |
| 180 | 180 |
| 181 /** |
| 182 * @override |
| 183 */ |
| 181 wasShown: function() | 184 wasShown: function() |
| 182 { | 185 { |
| 183 WebInspector.context.setFlavor(WebInspector.SourcesPanel, this); | 186 WebInspector.context.setFlavor(WebInspector.SourcesPanel, this); |
| 184 WebInspector.Panel.prototype.wasShown.call(this); | 187 WebInspector.Panel.prototype.wasShown.call(this); |
| 185 var wrapper = WebInspector.SourcesPanel.WrapperView._instance; | 188 var wrapper = WebInspector.SourcesPanel.WrapperView._instance; |
| 186 if (wrapper && wrapper.isShowing()) { | 189 if (wrapper && wrapper.isShowing()) { |
| 187 WebInspector.inspectorView.setDrawerMinimized(true); | 190 WebInspector.inspectorView.setDrawerMinimized(true); |
| 188 WebInspector.SourcesPanel.updateResizerAndSidebarButtons(this); | 191 WebInspector.SourcesPanel.updateResizerAndSidebarButtons(this); |
| 189 } | 192 } |
| 190 this.editorView.setMainWidget(this._sourcesView); | 193 this.editorView.setMainWidget(this._sourcesView); |
| 191 }, | 194 }, |
| 192 | 195 |
| 196 /** |
| 197 * @override |
| 198 */ |
| 193 willHide: function() | 199 willHide: function() |
| 194 { | 200 { |
| 195 WebInspector.Panel.prototype.willHide.call(this); | 201 WebInspector.Panel.prototype.willHide.call(this); |
| 196 WebInspector.context.setFlavor(WebInspector.SourcesPanel, null); | 202 WebInspector.context.setFlavor(WebInspector.SourcesPanel, null); |
| 197 if (WebInspector.SourcesPanel.WrapperView.isShowing()) { | 203 if (WebInspector.SourcesPanel.WrapperView.isShowing()) { |
| 198 WebInspector.SourcesPanel.WrapperView._instance._showViewInWrapper()
; | 204 WebInspector.SourcesPanel.WrapperView._instance._showViewInWrapper()
; |
| 199 WebInspector.inspectorView.setDrawerMinimized(false); | 205 WebInspector.inspectorView.setDrawerMinimized(false); |
| 200 WebInspector.SourcesPanel.updateResizerAndSidebarButtons(this); | 206 WebInspector.SourcesPanel.updateResizerAndSidebarButtons(this); |
| 201 } | 207 } |
| 202 }, | 208 }, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 220 _ensureSourcesViewVisible: function() | 226 _ensureSourcesViewVisible: function() |
| 221 { | 227 { |
| 222 if (WebInspector.SourcesPanel.WrapperView.isShowing()) | 228 if (WebInspector.SourcesPanel.WrapperView.isShowing()) |
| 223 return true; | 229 return true; |
| 224 if (!WebInspector.inspectorView.canSelectPanel("sources")) | 230 if (!WebInspector.inspectorView.canSelectPanel("sources")) |
| 225 return false; | 231 return false; |
| 226 WebInspector.viewManager.showView("sources"); | 232 WebInspector.viewManager.showView("sources"); |
| 227 return true; | 233 return true; |
| 228 }, | 234 }, |
| 229 | 235 |
| 236 /** |
| 237 * @override |
| 238 */ |
| 230 onResize: function() | 239 onResize: function() |
| 231 { | 240 { |
| 232 if (WebInspector.moduleSetting("sidebarPosition").get() === "auto") | 241 if (WebInspector.moduleSetting("sidebarPosition").get() === "auto") |
| 233 this.element.window().requestAnimationFrame(this._updateSidebarPosit
ion.bind(this)); // Do not force layout. | 242 this.element.window().requestAnimationFrame(this._updateSidebarPosit
ion.bind(this)); // Do not force layout. |
| 234 }, | 243 }, |
| 235 | 244 |
| 236 /** | 245 /** |
| 237 * @override | 246 * @override |
| 238 * @return {!WebInspector.SearchableView} | 247 * @return {!WebInspector.SearchableView} |
| 239 */ | 248 */ |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 308 |
| 300 /** | 309 /** |
| 301 * @param {!WebInspector.Event} event | 310 * @param {!WebInspector.Event} event |
| 302 */ | 311 */ |
| 303 _debuggerReset: function(event) | 312 _debuggerReset: function(event) |
| 304 { | 313 { |
| 305 this._debuggerResumed(event); | 314 this._debuggerResumed(event); |
| 306 }, | 315 }, |
| 307 | 316 |
| 308 /** | 317 /** |
| 309 * @return {!WebInspector.Widget} | 318 * @return {?WebInspector.Widget} |
| 310 */ | 319 */ |
| 311 get visibleView() | 320 get visibleView() |
| 312 { | 321 { |
| 313 return this._sourcesView.visibleView(); | 322 return this._sourcesView.visibleView(); |
| 314 }, | 323 }, |
| 315 | 324 |
| 316 /** | 325 /** |
| 317 * @param {!WebInspector.UISourceCode} uiSourceCode | 326 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 318 * @param {number=} lineNumber 0-based | 327 * @param {number=} lineNumber 0-based |
| 319 * @param {number=} columnNumber | 328 * @param {number=} columnNumber |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 */ | 1372 */ |
| 1364 WebInspector.SourcesPanel.WrapperView = function() | 1373 WebInspector.SourcesPanel.WrapperView = function() |
| 1365 { | 1374 { |
| 1366 WebInspector.VBox.call(this); | 1375 WebInspector.VBox.call(this); |
| 1367 this.element.classList.add("sources-view-wrapper"); | 1376 this.element.classList.add("sources-view-wrapper"); |
| 1368 WebInspector.SourcesPanel.WrapperView._instance = this; | 1377 WebInspector.SourcesPanel.WrapperView._instance = this; |
| 1369 this._view = WebInspector.SourcesPanel.instance()._sourcesView; | 1378 this._view = WebInspector.SourcesPanel.instance()._sourcesView; |
| 1370 }; | 1379 }; |
| 1371 | 1380 |
| 1372 WebInspector.SourcesPanel.WrapperView.prototype = { | 1381 WebInspector.SourcesPanel.WrapperView.prototype = { |
| 1382 /** |
| 1383 * @override |
| 1384 */ |
| 1373 wasShown: function() | 1385 wasShown: function() |
| 1374 { | 1386 { |
| 1375 if (!WebInspector.SourcesPanel.instance().isShowing()) | 1387 if (!WebInspector.SourcesPanel.instance().isShowing()) |
| 1376 this._showViewInWrapper(); | 1388 this._showViewInWrapper(); |
| 1377 else | 1389 else |
| 1378 WebInspector.inspectorView.setDrawerMinimized(true); | 1390 WebInspector.inspectorView.setDrawerMinimized(true); |
| 1379 WebInspector.SourcesPanel.updateResizerAndSidebarButtons(WebInspector.So
urcesPanel.instance()); | 1391 WebInspector.SourcesPanel.updateResizerAndSidebarButtons(WebInspector.So
urcesPanel.instance()); |
| 1380 }, | 1392 }, |
| 1381 | 1393 |
| 1394 /** |
| 1395 * @override |
| 1396 */ |
| 1382 willHide: function() | 1397 willHide: function() |
| 1383 { | 1398 { |
| 1384 WebInspector.inspectorView.setDrawerMinimized(false); | 1399 WebInspector.inspectorView.setDrawerMinimized(false); |
| 1385 setImmediate(() => WebInspector.SourcesPanel.updateResizerAndSidebarButt
ons(WebInspector.SourcesPanel.instance())); | 1400 setImmediate(() => WebInspector.SourcesPanel.updateResizerAndSidebarButt
ons(WebInspector.SourcesPanel.instance())); |
| 1386 }, | 1401 }, |
| 1387 | 1402 |
| 1388 _showViewInWrapper: function() | 1403 _showViewInWrapper: function() |
| 1389 { | 1404 { |
| 1390 this._view.show(this.element); | 1405 this._view.show(this.element); |
| 1391 }, | 1406 }, |
| 1392 | 1407 |
| 1393 __proto__: WebInspector.VBox.prototype | 1408 __proto__: WebInspector.VBox.prototype |
| 1394 }; | 1409 }; |
| 1395 | 1410 |
| 1396 /** | 1411 /** |
| 1397 * @return {boolean} | 1412 * @return {boolean} |
| 1398 */ | 1413 */ |
| 1399 WebInspector.SourcesPanel.WrapperView.isShowing = function() | 1414 WebInspector.SourcesPanel.WrapperView.isShowing = function() |
| 1400 { | 1415 { |
| 1401 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou
rcesPanel.WrapperView._instance.isShowing(); | 1416 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou
rcesPanel.WrapperView._instance.isShowing(); |
| 1402 }; | 1417 }; |
| OLD | NEW |