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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js

Issue 2756983002: [DevTools] Fallback to MainFrameNavigated event url in Security panel (Closed)
Patch Set: Add layout test Created 3 years, 9 months 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @implements {SDK.TargetManager.Observer} 5 * @implements {SDK.TargetManager.Observer}
6 * @unrestricted 6 * @unrestricted
7 */ 7 */
8 Security.SecurityPanel = class extends UI.PanelWithSidebar { 8 Security.SecurityPanel = class extends UI.PanelWithSidebar {
9 constructor() { 9 constructor() {
10 super('security'); 10 super('security');
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 340
341 this.selectAndSwitchToMainView(); 341 this.selectAndSwitchToMainView();
342 this._sidebarTree.clearOrigins(); 342 this._sidebarTree.clearOrigins();
343 this._origins.clear(); 343 this._origins.clear();
344 this._lastResponseReceivedForLoaderId.clear(); 344 this._lastResponseReceivedForLoaderId.clear();
345 this._filterRequestCounts.clear(); 345 this._filterRequestCounts.clear();
346 // After clearing the filtered request counts, refresh the 346 // After clearing the filtered request counts, refresh the
347 // explanations to reflect the new counts. 347 // explanations to reflect the new counts.
348 this._mainView.refreshExplanations(); 348 this._mainView.refreshExplanations();
349 349
350 if (request) { 350 // If we could not find a matching request (as in the case of clicking
351 var origin = Common.ParsedURL.extractOrigin(request.url()); 351 // through an interstitial, see crbug.com/669309), set the origin based upon
352 this._sidebarTree.setMainOrigin(origin); 352 // the url data from the MainFrameNavigated event itself.
353 const origin = Common.ParsedURL.extractOrigin(request ? request.url() : fram e.url);
lushnikov 2017/03/21 18:26:36 nit: we don't use 'const' since it causes V8 deopt
elawrence 2017/03/22 01:04:41 Done.
354 this._sidebarTree.setMainOrigin(origin);
355
356 if (request)
353 this._processRequest(request); 357 this._processRequest(request);
354 }
355 } 358 }
356 359
357 _onInterstitialShown() { 360 _onInterstitialShown() {
358 // The panel might have been displaying the origin view on the 361 // The panel might have been displaying the origin view on the
359 // previously loaded page. When showing an interstitial, switch 362 // previously loaded page. When showing an interstitial, switch
360 // back to the Overview view. 363 // back to the Overview view.
361 this.selectAndSwitchToMainView(); 364 this.selectAndSwitchToMainView();
362 this._sidebarTree.toggleOriginsList(true /* hidden */); 365 this._sidebarTree.toggleOriginsList(true /* hidden */);
363 } 366 }
364 367
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 var row = this._element.createChild('div', 'details-table-row'); 1045 var row = this._element.createChild('div', 'details-table-row');
1043 row.createChild('div').textContent = key; 1046 row.createChild('div').textContent = key;
1044 1047
1045 var valueDiv = row.createChild('div'); 1048 var valueDiv = row.createChild('div');
1046 if (typeof value === 'string') 1049 if (typeof value === 'string')
1047 valueDiv.textContent = value; 1050 valueDiv.textContent = value;
1048 else 1051 else
1049 valueDiv.appendChild(value); 1052 valueDiv.appendChild(value);
1050 } 1053 }
1051 }; 1054 };
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/security/main-origin-assigned-despite-request-missing-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698