Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |