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

Side by Side Diff: Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js

Issue 826713005: DevTools: Highlight changed scope variables as they change (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressing feedback Created 5 years, 11 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) IBM Corp. 2009 All rights reserved. 2 * Copyright (C) IBM Corp. 2009 All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 18 matching lines...) Expand all
29 */ 29 */
30 30
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @extends {WebInspector.SidebarPane} 33 * @extends {WebInspector.SidebarPane}
34 */ 34 */
35 WebInspector.WatchExpressionsSidebarPane = function() 35 WebInspector.WatchExpressionsSidebarPane = function()
36 { 36 {
37 WebInspector.SidebarPane.call(this, WebInspector.UIString("Watch Expressions ")); 37 WebInspector.SidebarPane.call(this, WebInspector.UIString("Watch Expressions "));
38 38
39 this.section = new WebInspector.WatchExpressionsSection(); 39 this.section = new WebInspector.WatchExpressionsSection(this);
40 this.bodyElement.appendChild(this.section.element); 40 this.bodyElement.appendChild(this.section.element);
41 41
42 var refreshButton = this.titleElement.createChild("button", "pane-title-butt on refresh"); 42 var refreshButton = this.titleElement.createChild("button", "pane-title-butt on refresh");
43 refreshButton.addEventListener("click", this._refreshButtonClicked.bind(this ), false); 43 refreshButton.addEventListener("click", this._refreshButtonClicked.bind(this ), false);
44 refreshButton.title = WebInspector.UIString("Refresh"); 44 refreshButton.title = WebInspector.UIString("Refresh");
45 45
46 var addButton = this.titleElement.createChild("button", "pane-title-button a dd"); 46 var addButton = this.titleElement.createChild("button", "pane-title-button a dd");
47 addButton.addEventListener("click", this._addButtonClicked.bind(this), false ); 47 addButton.addEventListener("click", this._addButtonClicked.bind(this), false );
48 addButton.title = WebInspector.UIString("Add watch expression"); 48 addButton.title = WebInspector.UIString("Add watch expression");
49 49
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 event.consume(); 93 event.consume();
94 this.refreshExpressions(); 94 this.refreshExpressions();
95 }, 95 },
96 96
97 __proto__: WebInspector.SidebarPane.prototype 97 __proto__: WebInspector.SidebarPane.prototype
98 } 98 }
99 99
100 /** 100 /**
101 * @constructor 101 * @constructor
102 * @extends {WebInspector.Section} 102 * @extends {WebInspector.Section}
103 * @param {!WebInspector.SidebarPane} sidebarPane
103 */ 104 */
104 WebInspector.WatchExpressionsSection = function() 105 WebInspector.WatchExpressionsSection = function(sidebarPane)
105 { 106 {
106 this._watchObjectGroupId = "watch-group"; 107 this._watchObjectGroupId = "watch-group";
107 108
108 WebInspector.Section.call(this, ""); 109 WebInspector.Section.call(this, "");
109 this.treeElementConstructor = WebInspector.ObjectPropertyTreeElement; 110 this.treeElementConstructor = WebInspector.ObjectPropertyTreeElement;
110 this.skipProto = false; 111 this.skipProto = false;
111 112
112 this.emptyElement = createElementWithClass("div", "info"); 113 this.emptyElement = createElementWithClass("div", "info");
113 this.emptyElement.textContent = WebInspector.UIString("No Watch Expressions" ); 114 this.emptyElement.textContent = WebInspector.UIString("No Watch Expressions" );
114 115
115 /** @type {!Array.<string>} */ 116 /** @type {!Array.<string>} */
116 this.watchExpressions = WebInspector.settings.watchExpressions.get(); 117 this.watchExpressions = WebInspector.settings.watchExpressions.get();
117 118
118 this.headerElement.className = "hidden"; 119 this.headerElement.className = "hidden";
119 this.editable = true; 120 this.editable = true;
120 this.expand(); 121 this.expand();
121 this.propertiesElement.classList.add("watch-expressions"); 122 this.propertiesElement.classList.add("watch-expressions");
122 123
123 this.element.addEventListener("mousemove", this._mouseMove.bind(this), true) ; 124 this.element.addEventListener("mousemove", this._mouseMove.bind(this), true) ;
124 this.element.addEventListener("mouseleave", this._mouseLeave.bind(this), tru e); 125 this.element.addEventListener("mouseleave", this._mouseLeave.bind(this), tru e);
125 this.element.addEventListener("dblclick", this._sectionDoubleClick.bind(this ), false); 126 this.element.addEventListener("dblclick", this._sectionDoubleClick.bind(this ), false);
126 this.emptyElement.addEventListener("contextmenu", this._emptyElementContextM enu.bind(this), false); 127 this.emptyElement.addEventListener("contextmenu", this._emptyElementContextM enu.bind(this), false);
128 this.pane = sidebarPane;
127 } 129 }
128 130
129 WebInspector.WatchExpressionsSection.NewWatchExpression = "\xA0"; 131 WebInspector.WatchExpressionsSection.NewWatchExpression = "\xA0";
130 132
131 WebInspector.WatchExpressionsSection.prototype = { 133 WebInspector.WatchExpressionsSection.prototype = {
132 /** 134 /**
133 * @param {!Event=} e 135 * @param {!Event=} e
134 */ 136 */
135 update: function(e) 137 update: function(e)
136 { 138 {
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 */ 482 */
481 applyExpression: function(expression) 483 applyExpression: function(expression)
482 { 484 {
483 expression = expression.trim(); 485 expression = expression.trim();
484 this.property.name = expression || null; 486 this.property.name = expression || null;
485 this.treeOutline.section.updateExpression(this, expression); 487 this.treeOutline.section.updateExpression(this, expression);
486 }, 488 },
487 489
488 __proto__: WebInspector.ObjectPropertyTreeElement.prototype 490 __proto__: WebInspector.ObjectPropertyTreeElement.prototype
489 } 491 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698