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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 return true; | 923 return true; |
924 }, | 924 }, |
925 | 925 |
926 __proto__: WebInspector.VBox.prototype | 926 __proto__: WebInspector.VBox.prototype |
927 } | 927 } |
928 | 928 |
929 /** | 929 /** |
930 * @param {!Element} element | 930 * @param {!Element} element |
931 * @constructor | 931 * @constructor |
932 */ | 932 */ |
933 WebInspector.ScreencastView.ProgressTracker = function(element) { | 933 WebInspector.ScreencastView.ProgressTracker = function(element) |
| 934 { |
934 this._element = element; | 935 this._element = element; |
935 | 936 |
936 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.MainFrameNavigated, this._onMainFrameNavigated, this); | 937 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel,
WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._onMainFrameN
avigated, this); |
937 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod
el.EventTypes.Load, this._onLoad, this); | 938 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel,
WebInspector.ResourceTreeModel.EventTypes.Load, this._onLoad, this); |
938 | 939 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web
Inspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this
); |
939 WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.Eve
ntTypes.RequestStarted, this._onRequestStarted, this); | 940 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web
Inspector.NetworkManager.EventTypes.RequestFinished, this._onRequestFinished, th
is); |
940 WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.Eve
ntTypes.RequestFinished, this._onRequestFinished, this); | 941 } |
941 }; | |
942 | 942 |
943 WebInspector.ScreencastView.ProgressTracker.prototype = { | 943 WebInspector.ScreencastView.ProgressTracker.prototype = { |
944 _onMainFrameNavigated: function() | 944 _onMainFrameNavigated: function() |
945 { | 945 { |
946 this._requestIds = {}; | 946 this._requestIds = {}; |
947 this._startedRequests = 0; | 947 this._startedRequests = 0; |
948 this._finishedRequests = 0; | 948 this._finishedRequests = 0; |
949 this._maxDisplayedProgress = 0; | 949 this._maxDisplayedProgress = 0; |
950 this._updateProgress(0.1); // Display first 10% on navigation start. | 950 this._updateProgress(0.1); // Display first 10% on navigation start. |
951 }, | 951 }, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 return; | 998 return; |
999 this._maxDisplayedProgress = progress; | 999 this._maxDisplayedProgress = progress; |
1000 this._displayProgress(progress); | 1000 this._displayProgress(progress); |
1001 }, | 1001 }, |
1002 | 1002 |
1003 _displayProgress: function(progress) | 1003 _displayProgress: function(progress) |
1004 { | 1004 { |
1005 this._element.style.width = (100 * progress) + "%"; | 1005 this._element.style.width = (100 * progress) + "%"; |
1006 } | 1006 } |
1007 }; | 1007 }; |
OLD | NEW |