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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js

Issue 2604883002: DevTools: namespace globals (Closed)
Patch Set: address CL feedback Created 3 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 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Audits2.Audits2Panel = class extends UI.Panel { 7 Audits2.Audits2Panel = class extends UI.Panel {
8 constructor() { 8 constructor() {
9 super('audits2'); 9 super('audits2');
10 this.contentElement.classList.add('vbox'); 10 this.contentElement.classList.add('vbox');
11 this.contentElement.appendChild(createTextButton(Common.UIString('Start'), t his._start.bind(this))); 11 this.contentElement.appendChild(UI.createTextButton(Common.UIString('Start') , this._start.bind(this)));
12 this.contentElement.appendChild(createTextButton(Common.UIString('Stop'), th is._stop.bind(this))); 12 this.contentElement.appendChild(UI.createTextButton(Common.UIString('Stop'), this._stop.bind(this)));
13 this._resultElement = this.contentElement.createChild('div', 'overflow-auto' ); 13 this._resultElement = this.contentElement.createChild('div', 'overflow-auto' );
14 } 14 }
15 15
16 _start() { 16 _start() {
17 SDK.targetManager.interceptMainConnection(this._dispatchProtocolMessage.bind (this)).then(rawConnection => { 17 SDK.targetManager.interceptMainConnection(this._dispatchProtocolMessage.bind (this)).then(rawConnection => {
18 this._rawConnection = rawConnection; 18 this._rawConnection = rawConnection;
19 this._send('start').then(result => { 19 this._send('start').then(result => {
20 var section = new Components.ObjectPropertiesSection( 20 var section = new Components.ObjectPropertiesSection(
21 SDK.RemoteObject.fromLocalObject(result), Common.UIString('Audit Res ults')); 21 SDK.RemoteObject.fromLocalObject(result), Common.UIString('Audit Res ults'));
22 this._resultElement.appendChild(section.element); 22 this._resultElement.appendChild(section.element);
(...skipping 27 matching lines...) Expand all
50 if (!this._backendPromise) { 50 if (!this._backendPromise) {
51 this._backendPromise = 51 this._backendPromise =
52 Services.serviceManager.createAppService('audits2_worker', 'Audits2Ser vice', false).then(backend => { 52 Services.serviceManager.createAppService('audits2_worker', 'Audits2Ser vice', false).then(backend => {
53 this._backend = backend; 53 this._backend = backend;
54 this._backend.on('sendProtocolMessage', result => this._rawConnectio n.sendMessage(result.message)); 54 this._backend.on('sendProtocolMessage', result => this._rawConnectio n.sendMessage(result.message));
55 }); 55 });
56 } 56 }
57 return this._backendPromise.then(() => this._backend ? this._backend.send(me thod, params) : undefined); 57 return this._backendPromise.then(() => this._backend ? this._backend.send(me thod, params) : undefined);
58 } 58 }
59 }; 59 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698