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

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

Issue 2553043003: [DevTools] Remove methods on Common.Event. (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) 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 25 matching lines...) Expand all
36 Sources.WatchExpressionsSidebarPane = class extends UI.ThrottledWidget { 36 Sources.WatchExpressionsSidebarPane = class extends UI.ThrottledWidget {
37 constructor() { 37 constructor() {
38 super(); 38 super();
39 this.registerRequiredCSS('components/objectValue.css'); 39 this.registerRequiredCSS('components/objectValue.css');
40 40
41 /** @type {!Array.<!Sources.WatchExpression>} */ 41 /** @type {!Array.<!Sources.WatchExpression>} */
42 this._watchExpressions = []; 42 this._watchExpressions = [];
43 this._watchExpressionsSetting = Common.settings.createLocalSetting('watchExp ressions', []); 43 this._watchExpressionsSetting = Common.settings.createLocalSetting('watchExp ressions', []);
44 44
45 this._addButton = new UI.ToolbarButton(Common.UIString('Add expression'), 'l argeicon-add'); 45 this._addButton = new UI.ToolbarButton(Common.UIString('Add expression'), 'l argeicon-add');
46 this._addButton.addEventListener('click', this._addButtonClicked.bind(this)) ; 46 this._addButton.addEventListener(UI.ToolbarButton.Events.Click, this._addBut tonClicked.bind(this));
47 this._refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'larg eicon-refresh'); 47 this._refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'larg eicon-refresh');
48 this._refreshButton.addEventListener('click', this._refreshButtonClicked.bin d(this)); 48 this._refreshButton.addEventListener(UI.ToolbarButton.Events.Click, this._re freshButtonClicked, this);
49 49
50 this._bodyElement = this.element.createChild('div', 'vbox watch-expressions' ); 50 this._bodyElement = this.element.createChild('div', 'vbox watch-expressions' );
51 this._bodyElement.addEventListener('contextmenu', this._contextMenu.bind(thi s), false); 51 this._bodyElement.addEventListener('contextmenu', this._contextMenu.bind(thi s), false);
52 this._expandController = new Components.ObjectPropertiesSectionExpandControl ler(); 52 this._expandController = new Components.ObjectPropertiesSectionExpandControl ler();
53 53
54 UI.context.addFlavorChangeListener(SDK.ExecutionContext, this.update, this); 54 UI.context.addFlavorChangeListener(SDK.ExecutionContext, this.update, this);
55 UI.context.addFlavorChangeListener(SDK.DebuggerModel.CallFrame, this.update, this); 55 UI.context.addFlavorChangeListener(SDK.DebuggerModel.CallFrame, this.update, this);
56 this._linkifier = new Components.Linkifier(); 56 this._linkifier = new Components.Linkifier();
57 this.update(); 57 this.update();
58 } 58 }
(...skipping 16 matching lines...) Expand all
75 _saveExpressions() { 75 _saveExpressions() {
76 var toSave = []; 76 var toSave = [];
77 for (var i = 0; i < this._watchExpressions.length; i++) { 77 for (var i = 0; i < this._watchExpressions.length; i++) {
78 if (this._watchExpressions[i].expression()) 78 if (this._watchExpressions[i].expression())
79 toSave.push(this._watchExpressions[i].expression()); 79 toSave.push(this._watchExpressions[i].expression());
80 } 80 }
81 81
82 this._watchExpressionsSetting.set(toSave); 82 this._watchExpressionsSetting.set(toSave);
83 } 83 }
84 84
85 /** 85 _addButtonClicked() {
86 * @param {!Common.Event=} event
87 */
88 _addButtonClicked(event) {
89 if (event)
90 event.consume(true);
91 UI.viewManager.showView('sources.watch'); 86 UI.viewManager.showView('sources.watch');
92 this._createWatchExpression(null).startEditing(); 87 this._createWatchExpression(null).startEditing();
93 } 88 }
94 89
95 /** 90 /**
96 * @param {!Common.Event} event 91 * @param {!Common.Event} event
97 */ 92 */
98 _refreshButtonClicked(event) { 93 _refreshButtonClicked(event) {
99 event.consume();
100 this.update(); 94 this.update();
lushnikov 2016/12/06 20:21:51 nit: we can just inline this
dgozman 2016/12/06 21:36:16 Done.
101 } 95 }
102 96
103 /** 97 /**
104 * @override 98 * @override
105 * @return {!Promise.<?>} 99 * @return {!Promise.<?>}
106 */ 100 */
107 doUpdate() { 101 doUpdate() {
108 this._linkifier.reset(); 102 this._linkifier.reset();
109 this._bodyElement.removeChildren(); 103 this._bodyElement.removeChildren();
110 this._watchExpressions = []; 104 this._watchExpressions = [];
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 InspectorFrontendHost.copyText(this._valueElement.textContent); 424 InspectorFrontendHost.copyText(this._valueElement.textContent);
431 } 425 }
432 }; 426 };
433 427
434 Sources.WatchExpression._watchObjectGroupId = 'watch-group'; 428 Sources.WatchExpression._watchObjectGroupId = 'watch-group';
435 429
436 /** @enum {symbol} */ 430 /** @enum {symbol} */
437 Sources.WatchExpression.Events = { 431 Sources.WatchExpression.Events = {
438 ExpressionUpdated: Symbol('ExpressionUpdated') 432 ExpressionUpdated: Symbol('ExpressionUpdated')
439 }; 433 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698