| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 this._context.fillStyle = this._cssColor(fillColor); | 552 this._context.fillStyle = this._cssColor(fillColor); |
| 553 this._context.fill(); | 553 this._context.fill(); |
| 554 this._context.restore(); | 554 this._context.restore(); |
| 555 }, | 555 }, |
| 556 | 556 |
| 557 /** | 557 /** |
| 558 * @param {!DOMAgent.Quad} quad | 558 * @param {!DOMAgent.Quad} quad |
| 559 * @param {!DOMAgent.Quad} clipQuad | 559 * @param {!DOMAgent.Quad} clipQuad |
| 560 * @param {!DOMAgent.RGBA} fillColor | 560 * @param {!DOMAgent.RGBA} fillColor |
| 561 */ | 561 */ |
| 562 _drawOutlinedQuadWithClip: function (quad, clipQuad, fillColor) | 562 _drawOutlinedQuadWithClip: function(quad, clipQuad, fillColor) |
| 563 { | 563 { |
| 564 this._context.fillStyle = this._cssColor(fillColor); | 564 this._context.fillStyle = this._cssColor(fillColor); |
| 565 this._context.save(); | 565 this._context.save(); |
| 566 this._context.lineWidth = 0; | 566 this._context.lineWidth = 0; |
| 567 this._quadToPath(quad).fill(); | 567 this._quadToPath(quad).fill(); |
| 568 this._context.globalCompositeOperation = "destination-out"; | 568 this._context.globalCompositeOperation = "destination-out"; |
| 569 this._context.fillStyle = "red"; | 569 this._context.fillStyle = "red"; |
| 570 this._quadToPath(clipQuad).fill(); | 570 this._quadToPath(clipQuad).fill(); |
| 571 this._context.restore(); | 571 this._context.restore(); |
| 572 }, | 572 }, |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 | 715 |
| 716 this._navigationForward = this._navigationBar.createChild("button", "for
ward"); | 716 this._navigationForward = this._navigationBar.createChild("button", "for
ward"); |
| 717 this._navigationForward.disabled = true; | 717 this._navigationForward.disabled = true; |
| 718 this._navigationForward.addEventListener("click", this._navigateToHistor
yEntry.bind(this, 1), false); | 718 this._navigationForward.addEventListener("click", this._navigateToHistor
yEntry.bind(this, 1), false); |
| 719 | 719 |
| 720 this._navigationReload = this._navigationBar.createChild("button", "relo
ad"); | 720 this._navigationReload = this._navigationBar.createChild("button", "relo
ad"); |
| 721 this._navigationReload.addEventListener("click", this._navigateReload.bi
nd(this), false); | 721 this._navigationReload.addEventListener("click", this._navigateReload.bi
nd(this), false); |
| 722 | 722 |
| 723 this._navigationUrl = this._navigationBar.createChild("input"); | 723 this._navigationUrl = this._navigationBar.createChild("input"); |
| 724 this._navigationUrl.type = "text"; | 724 this._navigationUrl.type = "text"; |
| 725 this._navigationUrl.addEventListener('keyup', this._navigationUrlKeyUp.b
ind(this), true); | 725 this._navigationUrl.addEventListener("keyup", this._navigationUrlKeyUp.b
ind(this), true); |
| 726 | 726 |
| 727 this._navigationProgressBar = new WebInspector.ScreencastView.ProgressTr
acker(this._navigationBar.createChild("div", "progress")); | 727 this._navigationProgressBar = new WebInspector.ScreencastView.ProgressTr
acker(this._navigationBar.createChild("div", "progress")); |
| 728 | 728 |
| 729 this._requestNavigationHistory(); | 729 this._requestNavigationHistory(); |
| 730 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.E
vents.InspectedURLChanged, this._requestNavigationHistory, this); | 730 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.E
vents.InspectedURLChanged, this._requestNavigationHistory, this); |
| 731 }, | 731 }, |
| 732 | 732 |
| 733 _navigateToHistoryEntry: function(offset) | 733 _navigateToHistoryEntry: function(offset) |
| 734 { | 734 { |
| 735 var newIndex = this._historyIndex + offset; | 735 var newIndex = this._historyIndex + offset; |
| 736 if (newIndex < 0 || newIndex >= this._historyEntries.length) | 736 if (newIndex < 0 || newIndex >= this._historyEntries.length) |
| 737 return; | 737 return; |
| 738 this._target.pageAgent().navigateToHistoryEntry(this._historyEntries[new
Index].id); | 738 this._target.pageAgent().navigateToHistoryEntry(this._historyEntries[new
Index].id); |
| 739 this._requestNavigationHistory(); | 739 this._requestNavigationHistory(); |
| 740 }, | 740 }, |
| 741 | 741 |
| 742 _navigateReload: function() | 742 _navigateReload: function() |
| 743 { | 743 { |
| 744 this._target.resourceTreeModel.reloadPage(); | 744 this._target.resourceTreeModel.reloadPage(); |
| 745 }, | 745 }, |
| 746 | 746 |
| 747 _navigationUrlKeyUp: function(event) | 747 _navigationUrlKeyUp: function(event) |
| 748 { | 748 { |
| 749 if (event.keyIdentifier != 'Enter') | 749 if (event.keyIdentifier != "Enter") |
| 750 return; | 750 return; |
| 751 var url = this._navigationUrl.value; | 751 var url = this._navigationUrl.value; |
| 752 if (!url) | 752 if (!url) |
| 753 return; | 753 return; |
| 754 if (!url.match(WebInspector.ScreencastView._SchemeRegex)) | 754 if (!url.match(WebInspector.ScreencastView._SchemeRegex)) |
| 755 url = "http://" + url; | 755 url = "http://" + url; |
| 756 this._target.pageAgent().navigate(url); | 756 this._target.pageAgent().navigate(url); |
| 757 this._canvasElement.focus(); | 757 this._canvasElement.focus(); |
| 758 }, | 758 }, |
| 759 | 759 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 return; | 863 return; |
| 864 this._maxDisplayedProgress = progress; | 864 this._maxDisplayedProgress = progress; |
| 865 this._displayProgress(progress); | 865 this._displayProgress(progress); |
| 866 }, | 866 }, |
| 867 | 867 |
| 868 _displayProgress: function(progress) | 868 _displayProgress: function(progress) |
| 869 { | 869 { |
| 870 this._element.style.width = (100 * progress) + "%"; | 870 this._element.style.width = (100 * progress) + "%"; |
| 871 } | 871 } |
| 872 }; | 872 }; |
| OLD | NEW |