Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 this._agent = target.pageAgent(); | 48 this._agent = target.pageAgent(); |
| 49 this._agent.enable(); | 49 this._agent.enable(); |
| 50 this._securityOriginManager = securityOriginManager; | 50 this._securityOriginManager = securityOriginManager; |
| 51 | 51 |
| 52 this._fetchResourceTree(); | 52 this._fetchResourceTree(); |
| 53 | 53 |
| 54 target.registerPageDispatcher(new SDK.PageDispatcher(this)); | 54 target.registerPageDispatcher(new SDK.PageDispatcher(this)); |
| 55 | 55 |
| 56 this._pendingReloadOptions = null; | 56 this._pendingReloadOptions = null; |
| 57 this._reloadSuspensionCount = 0; | 57 this._reloadSuspensionCount = 0; |
| 58 this._isInterstitialShowing = false; | |
| 58 } | 59 } |
| 59 | 60 |
| 60 /** | 61 /** |
| 61 * @param {!SDK.Target} target | 62 * @param {!SDK.Target} target |
| 62 * @return {?SDK.ResourceTreeModel} | 63 * @return {?SDK.ResourceTreeModel} |
| 63 */ | 64 */ |
| 64 static fromTarget(target) { | 65 static fromTarget(target) { |
| 65 return /** @type {?SDK.ResourceTreeModel} */ (target.model(SDK.ResourceTreeM odel)); | 66 return /** @type {?SDK.ResourceTreeModel} */ (target.model(SDK.ResourceTreeM odel)); |
| 66 } | 67 } |
| 67 | 68 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 } | 110 } |
| 110 | 111 |
| 111 /** | 112 /** |
| 112 * @return {boolean} | 113 * @return {boolean} |
| 113 */ | 114 */ |
| 114 cachedResourcesLoaded() { | 115 cachedResourcesLoaded() { |
| 115 return this._cachedResourcesProcessed; | 116 return this._cachedResourcesProcessed; |
| 116 } | 117 } |
| 117 | 118 |
| 118 /** | 119 /** |
| 120 * @return {boolean} | |
| 121 */ | |
| 122 isInterstitialShowing() { | |
| 123 return this._isInterstitialShowing; | |
| 124 } | |
| 125 | |
| 126 /** | |
| 127 * @param {boolean=} showing | |
| 128 */ | |
| 129 setIsInterstitialShowing(showing) { | |
| 130 this._isInterstitialShowing = showing; | |
| 131 } | |
| 132 | |
| 133 /** | |
| 119 * @param {!SDK.ResourceTreeFrame} frame | 134 * @param {!SDK.ResourceTreeFrame} frame |
| 120 * @param {boolean=} aboutToNavigate | 135 * @param {boolean=} aboutToNavigate |
| 121 */ | 136 */ |
| 122 _addFrame(frame, aboutToNavigate) { | 137 _addFrame(frame, aboutToNavigate) { |
| 123 this._frames.set(frame.id, frame); | 138 this._frames.set(frame.id, frame); |
| 124 if (frame.isMainFrame()) { | 139 if (frame.isMainFrame()) { |
| 125 this.mainFrame = frame; | 140 this.mainFrame = frame; |
| 126 this._securityOriginManager.setMainSecurityOrigin(frame.url); | 141 this._securityOriginManager.setMainSecurityOrigin(frame.url); |
| 127 } | 142 } |
| 128 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameAdded, frame ); | 143 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameAdded, frame ); |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 852 * @param {!Protocol.DOM.RGBA} color | 867 * @param {!Protocol.DOM.RGBA} color |
| 853 */ | 868 */ |
| 854 colorPicked(color) { | 869 colorPicked(color) { |
| 855 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.ColorPicked, color); | 870 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.ColorPicked, color); |
| 856 } | 871 } |
| 857 | 872 |
| 858 /** | 873 /** |
| 859 * @override | 874 * @override |
| 860 */ | 875 */ |
| 861 interstitialShown() { | 876 interstitialShown() { |
| 877 this._resourceTreeModel.setIsInterstitialShowing(true); | |
|
dgozman
2016/11/29 02:07:23
Let's just assign directly to a private field here
estark
2016/11/29 02:11:36
Done.
| |
| 862 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.InterstitialShown); | 878 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.InterstitialShown); |
| 863 } | 879 } |
| 864 | 880 |
| 865 /** | 881 /** |
| 866 * @override | 882 * @override |
| 867 */ | 883 */ |
| 868 interstitialHidden() { | 884 interstitialHidden() { |
| 885 this._resourceTreeModel.setIsInterstitialShowing(false); | |
| 869 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.InterstitialHidden); | 886 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.InterstitialHidden); |
| 870 } | 887 } |
| 871 | 888 |
| 872 /** | 889 /** |
| 873 * @override | 890 * @override |
| 874 */ | 891 */ |
| 875 navigationRequested() { | 892 navigationRequested() { |
| 876 // Frontend is not interested in when navigations are requested. | 893 // Frontend is not interested in when navigations are requested. |
| 877 } | 894 } |
| 878 }; | 895 }; |
| OLD | NEW |