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

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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 return anchor; 583 return anchor;
584 }, 584 },
585 585
586 /** 586 /**
587 * @param {!Element} anchor 587 * @param {!Element} anchor
588 * @param {!WebInspector.Popover} popover 588 * @param {!WebInspector.Popover} popover
589 */ 589 */
590 _showPopover: function(anchor, popover) 590 _showPopover: function(anchor, popover)
591 { 591 {
592 var node = this.selectedDOMNode(); 592 var node = this.selectedDOMNode();
593 if (node) 593 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(node.t arget());
594 WebInspector.DOMPresentationUtils.buildImagePreviewContents(node.tar get(), anchor.href, true, showPopover); 594 if (node && resourceTreeModel)
595 WebInspector.DOMPresentationUtils.buildImagePreviewContents(resource TreeModel, anchor.href, true, showPopover);
595 596
596 /** 597 /**
597 * @param {!Element=} contents 598 * @param {!Element=} contents
598 */ 599 */
599 function showPopover(contents) 600 function showPopover(contents)
600 { 601 {
601 if (!contents) 602 if (!contents)
602 return; 603 return;
603 popover.setCanShrink(false); 604 popover.setCanShrink(false);
604 popover.showForAnchor(contents, anchor); 605 popover.showForAnchor(contents, anchor);
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 */ 1290 */
1290 wasShown: function() 1291 wasShown: function()
1291 { 1292 {
1292 this._toolbarItem.setToggled(true); 1293 this._toolbarItem.setToggled(true);
1293 this._nodeChanged(); 1294 this._nodeChanged();
1294 WebInspector.ThrottledWidget.prototype.wasShown.call(this); 1295 WebInspector.ThrottledWidget.prototype.wasShown.call(this);
1295 }, 1296 },
1296 1297
1297 __proto__: WebInspector.ThrottledWidget.prototype 1298 __proto__: WebInspector.ThrottledWidget.prototype
1298 } 1299 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698