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

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

Issue 2881453003: DevTools: update buttons to new style (Closed)
Patch Set: fix test Created 3 years, 6 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 /** 5 /**
6 * @implements {SDK.SDKModelObserver<!SDK.ServiceWorkerManager>} 6 * @implements {SDK.SDKModelObserver<!SDK.ServiceWorkerManager>}
7 * @unrestricted 7 * @unrestricted
8 */ 8 */
9 Audits2.Audits2Panel = class extends UI.PanelWithSidebar { 9 Audits2.Audits2Panel = class extends UI.PanelWithSidebar {
10 constructor() { 10 constructor() {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 text.createChild('span', 'audits2-landing-bold-text').textContent = Common.U IString('Audits'); 152 text.createChild('span', 'audits2-landing-bold-text').textContent = Common.U IString('Audits');
153 text.createChild('span').textContent = Common.UIString( 153 text.createChild('span').textContent = Common.UIString(
154 ' help you identify and fix common problems that affect' + 154 ' help you identify and fix common problems that affect' +
155 ' your site\'s performance, accessibility, and user experience. '); 155 ' your site\'s performance, accessibility, and user experience. ');
156 var link = text.createChild('span', 'link'); 156 var link = text.createChild('span', 'link');
157 link.textContent = Common.UIString('Learn more'); 157 link.textContent = Common.UIString('Learn more');
158 link.addEventListener( 158 link.addEventListener(
159 'click', () => InspectorFrontendHost.openInNewTab('https://developers.go ogle.com/web/tools/lighthouse/')); 159 'click', () => InspectorFrontendHost.openInNewTab('https://developers.go ogle.com/web/tools/lighthouse/'));
160 160
161 var newButton = UI.createTextButton( 161 var newButton = UI.createTextButton(
162 Common.UIString('Perform an audit\u2026'), this._showLauncherUI.bind(thi s), 'material-button default'); 162 Common.UIString('Perform an audit\u2026'), this._showLauncherUI.bind(thi s), '', true /* primary */);
163 landingCenter.appendChild(newButton); 163 landingCenter.appendChild(newButton);
164 this.setDefaultFocusedElement(newButton); 164 this.setDefaultFocusedElement(newButton);
165 } 165 }
166 166
167 _showLauncherUI() { 167 _showLauncherUI() {
168 this._dialog = new UI.Dialog(); 168 this._dialog = new UI.Dialog();
169 this._dialog.setOutsideClickCallback(event => event.consume(true)); 169 this._dialog.setOutsideClickCallback(event => event.consume(true));
170 var root = UI.createShadowRootWithCoreStyles(this._dialog.contentElement, 'a udits2/audits2Dialog.css'); 170 var root = UI.createShadowRootWithCoreStyles(this._dialog.contentElement, 'a udits2/audits2Dialog.css');
171 var auditsViewElement = root.createChild('div', 'audits2-view'); 171 var auditsViewElement = root.createChild('div', 'audits2-view');
172 var uiElement = auditsViewElement.createChild('div'); 172 var uiElement = auditsViewElement.createChild('div');
(...skipping 10 matching lines...) Expand all
183 var row = this._auditSelectorForm.createChild('div', 'vbox audits2-launche r-row'); 183 var row = this._auditSelectorForm.createChild('div', 'vbox audits2-launche r-row');
184 row.appendChild(checkbox.element); 184 row.appendChild(checkbox.element);
185 row.createChild('span', 'audits2-launcher-description dimmed').textContent = preset.description; 185 row.createChild('span', 'audits2-launcher-description dimmed').textContent = preset.description;
186 } 186 }
187 187
188 this._statusView = this._createStatusView(uiElement); 188 this._statusView = this._createStatusView(uiElement);
189 this._dialogHelpText = uiElement.createChild('div', 'audits2-dialog-help-tex t'); 189 this._dialogHelpText = uiElement.createChild('div', 'audits2-dialog-help-tex t');
190 190
191 var buttonsRow = uiElement.createChild('div', 'audits2-dialog-buttons hbox') ; 191 var buttonsRow = uiElement.createChild('div', 'audits2-dialog-buttons hbox') ;
192 this._startButton = 192 this._startButton =
193 UI.createTextButton(Common.UIString('Run audit'), this._start.bind(this) , 'material-button default'); 193 UI.createTextButton(Common.UIString('Run audit'), this._start.bind(this) , '', true /* primary */);
194 this._updateStartButtonEnabled(); 194 this._updateStartButtonEnabled();
195 buttonsRow.appendChild(this._startButton); 195 buttonsRow.appendChild(this._startButton);
196 this._cancelButton = UI.createTextButton(Common.UIString('Cancel'), this._ca ncel.bind(this), 'material-button'); 196 this._cancelButton = UI.createTextButton(Common.UIString('Cancel'), this._ca ncel.bind(this));
197 buttonsRow.appendChild(this._cancelButton); 197 buttonsRow.appendChild(this._cancelButton);
198 198
199 this._dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.SetExactWidthMaxHeigh t); 199 this._dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.SetExactWidthMaxHeigh t);
200 this._dialog.setMaxContentSize(new UI.Size(500, 400)); 200 this._dialog.setMaxContentSize(new UI.Size(500, 400));
201 this._dialog.show(this.mainElement()); 201 this._dialog.show(this.mainElement());
202 auditsViewElement.tabIndex = 0; 202 auditsViewElement.tabIndex = 0;
203 auditsViewElement.focus(); 203 auditsViewElement.focus();
204 } 204 }
205 205
206 /** 206 /**
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 var node = domModel.nodeForId(nodeId); 759 var node = domModel.nodeForId(nodeId);
760 if (!node) 760 if (!node)
761 return; 761 return;
762 762
763 var element = Components.DOMPresentationUtils.linkifyNodeReference(node, und efined, detailsItem.snippet); 763 var element = Components.DOMPresentationUtils.linkifyNodeReference(node, und efined, detailsItem.snippet);
764 origElement.title = ''; 764 origElement.title = '';
765 origElement.textContent = ''; 765 origElement.textContent = '';
766 origElement.appendChild(element); 766 origElement.appendChild(element);
767 } 767 }
768 }; 768 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698