| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @interface | 6 * @interface |
| 7 */ | 7 */ |
| 8 WebInspector.View = function() | 8 WebInspector.View = function() |
| 9 { | 9 { |
| 10 } | 10 } |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 * @param {string} viewId | 318 * @param {string} viewId |
| 319 * @return {?WebInspector.View} | 319 * @return {?WebInspector.View} |
| 320 */ | 320 */ |
| 321 view: function(viewId) | 321 view: function(viewId) |
| 322 { | 322 { |
| 323 return this._views.get(viewId); | 323 return this._views.get(viewId); |
| 324 }, | 324 }, |
| 325 | 325 |
| 326 /** | 326 /** |
| 327 * @param {string} viewId | 327 * @param {string} viewId |
| 328 * @param {boolean=} skipReveal |
| 328 * @return {!Promise} | 329 * @return {!Promise} |
| 329 */ | 330 */ |
| 330 showView: function(viewId) | 331 showView: function(viewId, skipReveal) |
| 331 { | 332 { |
| 332 var view = this._views.get(viewId); | 333 var view = this._views.get(viewId); |
| 333 if (!view) { | 334 if (!view) { |
| 334 console.error("Could not find view for id: '" + viewId + "' " + new
Error().stack); | 335 console.error("Could not find view for id: '" + viewId + "' " + new
Error().stack); |
| 335 return Promise.resolve(); | 336 return Promise.resolve(); |
| 336 } | 337 } |
| 337 | 338 |
| 338 var locationName = this._locationNameByViewId.get(viewId); | 339 var locationName = this._locationNameByViewId.get(viewId); |
| 339 if (locationName === "drawer-view") | 340 if (locationName === "drawer-view") |
| 340 WebInspector.userMetrics.drawerShown(viewId); | 341 WebInspector.userMetrics.drawerShown(viewId); |
| 341 | 342 |
| 342 var location = view[WebInspector.ViewManager._Location.symbol]; | 343 var location = view[WebInspector.ViewManager._Location.symbol]; |
| 343 if (location) { | 344 if (location) { |
| 344 location._reveal(); | 345 if (!skipReveal) |
| 346 location._reveal(); |
| 345 return location.showView(view); | 347 return location.showView(view); |
| 346 } | 348 } |
| 347 | 349 |
| 348 return this._resolveLocation(locationName).then(location => { | 350 return this._resolveLocation(locationName).then(location => { |
| 349 if (!location) | 351 if (!location) |
| 350 throw new Error("Could not resolve location for view: " + viewId
); | 352 throw new Error("Could not resolve location for view: " + viewId
); |
| 351 location._reveal(); | 353 location._reveal(); |
| 352 return location.showView(view); | 354 return location.showView(view); |
| 353 }); | 355 }); |
| 354 }, | 356 }, |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 this.appendView(view); | 816 this.appendView(view); |
| 815 }, | 817 }, |
| 816 | 818 |
| 817 __proto__: WebInspector.ViewManager._Location.prototype | 819 __proto__: WebInspector.ViewManager._Location.prototype |
| 818 } | 820 } |
| 819 | 821 |
| 820 /** | 822 /** |
| 821 * @type {!WebInspector.ViewManager} | 823 * @type {!WebInspector.ViewManager} |
| 822 */ | 824 */ |
| 823 WebInspector.viewManager; | 825 WebInspector.viewManager; |
| OLD | NEW |