| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> | 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> |
| 4 * Copyright (C) 2011 Google Inc. All rights reserved. | 4 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 * @param {!Object} target | 503 * @param {!Object} target |
| 504 * @this {WebInspector.NetworkPanel} | 504 * @this {WebInspector.NetworkPanel} |
| 505 */ | 505 */ |
| 506 appendApplicableItems: function(event, contextMenu, target) | 506 appendApplicableItems: function(event, contextMenu, target) |
| 507 { | 507 { |
| 508 /** | 508 /** |
| 509 * @this {WebInspector.NetworkPanel} | 509 * @this {WebInspector.NetworkPanel} |
| 510 */ | 510 */ |
| 511 function reveal(request) | 511 function reveal(request) |
| 512 { | 512 { |
| 513 WebInspector.inspectorView.setCurrentPanel(this); | 513 WebInspector.viewManager.showView("network").then(this.revealAndHigh
lightRequest.bind(this, request)); |
| 514 this.revealAndHighlightRequest(request); | |
| 515 } | 514 } |
| 516 | 515 |
| 517 /** | 516 /** |
| 518 * @this {WebInspector.NetworkPanel} | 517 * @this {WebInspector.NetworkPanel} |
| 519 */ | 518 */ |
| 520 function appendRevealItem(request) | 519 function appendRevealItem(request) |
| 521 { | 520 { |
| 522 contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in N
etwork ^panel"), reveal.bind(this, request)); | 521 contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in N
etwork ^panel"), reveal.bind(this, request)); |
| 523 } | 522 } |
| 524 | 523 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 /** | 624 /** |
| 626 * @override | 625 * @override |
| 627 * @param {!Object} request | 626 * @param {!Object} request |
| 628 * @return {!Promise} | 627 * @return {!Promise} |
| 629 */ | 628 */ |
| 630 reveal: function(request) | 629 reveal: function(request) |
| 631 { | 630 { |
| 632 if (!(request instanceof WebInspector.NetworkRequest)) | 631 if (!(request instanceof WebInspector.NetworkRequest)) |
| 633 return Promise.reject(new Error("Internal error: not a network reque
st")); | 632 return Promise.reject(new Error("Internal error: not a network reque
st")); |
| 634 var panel = WebInspector.NetworkPanel._instance(); | 633 var panel = WebInspector.NetworkPanel._instance(); |
| 635 WebInspector.inspectorView.setCurrentPanel(panel); | 634 return WebInspector.viewManager.showView("network").then(panel.revealAnd
HighlightRequest.bind(panel, request)); |
| 636 panel.revealAndHighlightRequest(request); | |
| 637 return Promise.resolve(); | |
| 638 } | 635 } |
| 639 } | 636 } |
| 640 | 637 |
| 641 | |
| 642 WebInspector.NetworkPanel.show = function() | |
| 643 { | |
| 644 WebInspector.inspectorView.setCurrentPanel(WebInspector.NetworkPanel._instan
ce()); | |
| 645 } | |
| 646 | |
| 647 /** | 638 /** |
| 648 * @param {!Array<{filterType: !WebInspector.NetworkLogView.FilterType, filterVa
lue: string}>} filters | 639 * @param {!Array<{filterType: !WebInspector.NetworkLogView.FilterType, filterVa
lue: string}>} filters |
| 649 */ | 640 */ |
| 650 WebInspector.NetworkPanel.revealAndFilter = function(filters) | 641 WebInspector.NetworkPanel.revealAndFilter = function(filters) |
| 651 { | 642 { |
| 652 var panel = WebInspector.NetworkPanel._instance(); | 643 var panel = WebInspector.NetworkPanel._instance(); |
| 653 var filterString = ""; | 644 var filterString = ""; |
| 654 for (var filter of filters) | 645 for (var filter of filters) |
| 655 filterString += `${filter.filterType}:${filter.filterValue} `; | 646 filterString += `${filter.filterType}:${filter.filterValue} `; |
| 656 panel._networkLogView.setTextFilterValue(filterString); | 647 panel._networkLogView.setTextFilterValue(filterString); |
| 657 WebInspector.inspectorView.setCurrentPanel(panel); | 648 WebInspector.viewManager.showView("network"); |
| 658 } | 649 } |
| 659 | 650 |
| 660 /** | 651 /** |
| 661 * @return {!WebInspector.NetworkPanel} | 652 * @return {!WebInspector.NetworkPanel} |
| 662 */ | 653 */ |
| 663 WebInspector.NetworkPanel._instance = function() | 654 WebInspector.NetworkPanel._instance = function() |
| 664 { | 655 { |
| 665 return /** @type {!WebInspector.NetworkPanel} */ (self.runtime.sharedInstanc
e(WebInspector.NetworkPanel)); | 656 return /** @type {!WebInspector.NetworkPanel} */ (self.runtime.sharedInstanc
e(WebInspector.NetworkPanel)); |
| 666 } | 657 } |
| 667 | 658 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 * @return {boolean} | 768 * @return {boolean} |
| 778 */ | 769 */ |
| 779 handleAction: function(context, actionId) | 770 handleAction: function(context, actionId) |
| 780 { | 771 { |
| 781 var panel = WebInspector.context.flavor(WebInspector.NetworkPanel); | 772 var panel = WebInspector.context.flavor(WebInspector.NetworkPanel); |
| 782 console.assert(panel && panel instanceof WebInspector.NetworkPanel); | 773 console.assert(panel && panel instanceof WebInspector.NetworkPanel); |
| 783 panel._toggleRecording(); | 774 panel._toggleRecording(); |
| 784 return true; | 775 return true; |
| 785 } | 776 } |
| 786 } | 777 } |
| OLD | NEW |