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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js

Issue 2122353002: [DevTools] Make resource tree model optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 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 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 return anchor; 556 return anchor;
557 }, 557 },
558 558
559 /** 559 /**
560 * @param {!Element} anchor 560 * @param {!Element} anchor
561 * @param {!WebInspector.Popover} popover 561 * @param {!WebInspector.Popover} popover
562 */ 562 */
563 _showPopover: function(anchor, popover) 563 _showPopover: function(anchor, popover)
564 { 564 {
565 var node = this.selectedDOMNode(); 565 var node = this.selectedDOMNode();
566 if (node) 566 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(node.t arget());
pfeldman 2016/07/13 23:55:57 ditto
eostroukhov-old 2016/07/20 23:46:15 Reverted
567 WebInspector.DOMPresentationUtils.buildImagePreviewContents(node.tar get(), anchor.href, true, showPopover); 567 if (node && resourceTreeModel)
568 WebInspector.DOMPresentationUtils.buildImagePreviewContents(resource TreeModel, anchor.href, true, showPopover);
568 569
569 /** 570 /**
570 * @param {!Element=} contents 571 * @param {!Element=} contents
571 */ 572 */
572 function showPopover(contents) 573 function showPopover(contents)
573 { 574 {
574 if (!contents) 575 if (!contents)
575 return; 576 return;
576 popover.setCanShrink(false); 577 popover.setCanShrink(false);
577 popover.showForAnchor(contents, anchor); 578 popover.showForAnchor(contents, anchor);
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 /** 1181 /**
1181 * @override 1182 * @override
1182 * @param {!WebInspector.DOMNode} node 1183 * @param {!WebInspector.DOMNode} node
1183 * @return {?{title: string, color: string}} 1184 * @return {?{title: string, color: string}}
1184 */ 1185 */
1185 decorate: function(node) 1186 decorate: function(node)
1186 { 1187 {
1187 return { color: "orange", title: WebInspector.UIString("Element state: % s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; 1188 return { color: "orange", title: WebInspector.UIString("Element state: % s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) };
1188 } 1189 }
1189 } 1190 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698