Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js

Issue 2522733002: Do not prompt for reload when security panel is opened on an interstitial (Closed)
Patch Set: remove isInterstitialShowing setter Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 /**
119 * @param {!SDK.ResourceTreeFrame} frame 127 * @param {!SDK.ResourceTreeFrame} frame
120 * @param {boolean=} aboutToNavigate 128 * @param {boolean=} aboutToNavigate
121 */ 129 */
122 _addFrame(frame, aboutToNavigate) { 130 _addFrame(frame, aboutToNavigate) {
123 this._frames.set(frame.id, frame); 131 this._frames.set(frame.id, frame);
124 if (frame.isMainFrame()) { 132 if (frame.isMainFrame()) {
125 this.mainFrame = frame; 133 this.mainFrame = frame;
126 this._securityOriginManager.setMainSecurityOrigin(frame.url); 134 this._securityOriginManager.setMainSecurityOrigin(frame.url);
127 } 135 }
128 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameAdded, frame ); 136 this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameAdded, frame );
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 * @param {!Protocol.DOM.RGBA} color 860 * @param {!Protocol.DOM.RGBA} color
853 */ 861 */
854 colorPicked(color) { 862 colorPicked(color) {
855 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.ColorPicked, color); 863 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.ColorPicked, color);
856 } 864 }
857 865
858 /** 866 /**
859 * @override 867 * @override
860 */ 868 */
861 interstitialShown() { 869 interstitialShown() {
870 this._resourceTreeModel._isInterstitialShowing = true;
862 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.InterstitialShown); 871 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.InterstitialShown);
863 } 872 }
864 873
865 /** 874 /**
866 * @override 875 * @override
867 */ 876 */
868 interstitialHidden() { 877 interstitialHidden() {
878 this._resourceTreeModel._isInterstitialShowing = false;
869 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.InterstitialHidden); 879 this._resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Event s.InterstitialHidden);
870 } 880 }
871 881
872 /** 882 /**
873 * @override 883 * @override
874 */ 884 */
875 navigationRequested() { 885 navigationRequested() {
876 // Frontend is not interested in when navigations are requested. 886 // Frontend is not interested in when navigations are requested.
877 } 887 }
878 }; 888 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698