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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js

Issue 2782773002: [DevTools] Remove SDKModels' fromTarget methods (Closed)
Patch Set: addressed review comments Created 3 years, 8 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 property.type, /** @type {string} */ (property.subtype), property.value) ; 600 property.type, /** @type {string} */ (property.subtype), property.value) ;
601 } 601 }
602 602
603 /** 603 /**
604 * @param {!SDK.RemoteObject} remoteObject 604 * @param {!SDK.RemoteObject} remoteObject
605 * @return {!Element} 605 * @return {!Element}
606 */ 606 */
607 _formatParameterAsNode(remoteObject) { 607 _formatParameterAsNode(remoteObject) {
608 var result = createElement('span'); 608 var result = createElement('span');
609 609
610 var domModel = SDK.DOMModel.fromTarget(remoteObject.runtimeModel().target()) ; 610 var domModel = remoteObject.runtimeModel().target().model(SDK.DOMModel);
611 if (!domModel) 611 if (!domModel)
612 return result; 612 return result;
613 domModel.pushObjectAsNodeToFrontend(remoteObject).then(node => { 613 domModel.pushObjectAsNodeToFrontend(remoteObject).then(node => {
614 if (!node) { 614 if (!node) {
615 result.appendChild(this._formatParameterAsObject(remoteObject, false)); 615 result.appendChild(this._formatParameterAsObject(remoteObject, false));
616 return; 616 return;
617 } 617 }
618 Common.Renderer.renderPromise(node).then(rendererElement => { 618 Common.Renderer.renderPromise(node).then(rendererElement => {
619 result.appendChild(rendererElement); 619 result.appendChild(rendererElement);
620 this._formattedParameterAsNodeForTest(); 620 this._formattedParameterAsNodeForTest();
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 toMessageElement() { 1248 toMessageElement() {
1249 if (!this._element) { 1249 if (!this._element) {
1250 super.toMessageElement(); 1250 super.toMessageElement();
1251 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon'); 1251 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon');
1252 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem ent.firstChild); 1252 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem ent.firstChild);
1253 this.setCollapsed(this._collapsed); 1253 this.setCollapsed(this._collapsed);
1254 } 1254 }
1255 return this._element; 1255 return this._element;
1256 } 1256 }
1257 }; 1257 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698