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

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

Issue 2570783006: DevTools: convert a few more icons to UI.Icon. (Closed)
Patch Set: Created 4 years 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 * @param {!SDK.ConsoleMessage} consoleMessage 305 * @param {!SDK.ConsoleMessage} consoleMessage
306 * @param {!SDK.Target} target 306 * @param {!SDK.Target} target
307 * @param {!Components.Linkifier} linkifier 307 * @param {!Components.Linkifier} linkifier
308 * @return {!Element} 308 * @return {!Element}
309 */ 309 */
310 _buildMessageWithStackTrace(consoleMessage, target, linkifier) { 310 _buildMessageWithStackTrace(consoleMessage, target, linkifier) {
311 var toggleElement = createElementWithClass('div', 'console-message-stack-tra ce-toggle'); 311 var toggleElement = createElementWithClass('div', 'console-message-stack-tra ce-toggle');
312 var contentElement = toggleElement.createChild('div', 'console-message-stack -trace-wrapper'); 312 var contentElement = toggleElement.createChild('div', 'console-message-stack -trace-wrapper');
313 313
314 var messageElement = this._buildMessage(consoleMessage); 314 var messageElement = this._buildMessage(consoleMessage);
315 var icon = UI.Icon.create('smallicon-triangle-right', 'stack-trace-expand-ic on');
315 var clickableElement = contentElement.createChild('div'); 316 var clickableElement = contentElement.createChild('div');
317 clickableElement.appendChild(icon);
318
316 clickableElement.appendChild(messageElement); 319 clickableElement.appendChild(messageElement);
317 var stackTraceElement = contentElement.createChild('div'); 320 var stackTraceElement = contentElement.createChild('div');
318 var stackTracePreview = 321 var stackTracePreview =
319 Components.DOMPresentationUtils.buildStackTracePreviewContents(target, l inkifier, consoleMessage.stackTrace); 322 Components.DOMPresentationUtils.buildStackTracePreviewContents(target, l inkifier, consoleMessage.stackTrace);
320 stackTraceElement.appendChild(stackTracePreview); 323 stackTraceElement.appendChild(stackTracePreview);
321 stackTraceElement.classList.add('hidden'); 324 stackTraceElement.classList.add('hidden');
322 325
323 /** 326 /**
324 * @param {boolean} expand 327 * @param {boolean} expand
325 */ 328 */
326 function expandStackTrace(expand) { 329 function expandStackTrace(expand) {
330 icon.setIconType(expand ? 'smallicon-triangle-bottom' : 'smallicon-triangl e-right');
327 stackTraceElement.classList.toggle('hidden', !expand); 331 stackTraceElement.classList.toggle('hidden', !expand);
328 toggleElement.classList.toggle('expanded', expand);
329 } 332 }
330 333
331 /** 334 /**
332 * @param {?Event} event 335 * @param {?Event} event
333 */ 336 */
334 function toggleStackTrace(event) { 337 function toggleStackTrace(event) {
335 if (event.target.hasSelection()) 338 if (event.target.hasSelection())
336 return; 339 return;
337 expandStackTrace(stackTraceElement.classList.contains('hidden')); 340 expandStackTrace(stackTraceElement.classList.contains('hidden'));
338 event.consume(); 341 event.consume();
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 toMessageElement() { 1207 toMessageElement() {
1205 if (!this._element) { 1208 if (!this._element) {
1206 super.toMessageElement(); 1209 super.toMessageElement();
1207 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon'); 1210 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon');
1208 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem ent.firstChild); 1211 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem ent.firstChild);
1209 this.setCollapsed(this._collapsed); 1212 this.setCollapsed(this._collapsed);
1210 } 1213 }
1211 return this._element; 1214 return this._element;
1212 } 1215 }
1213 }; 1216 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698