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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js

Issue 2573323002: Revert of [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 // 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 * @implements {SDK.TargetManager.Observer} 5 * @implements {SDK.TargetManager.Observer}
6 * @unrestricted 6 * @unrestricted
7 */ 7 */
8 Resources.AppManifestView = class extends UI.VBox { 8 Resources.AppManifestView = class extends UI.VBox {
9 constructor() { 9 constructor() {
10 super(true); 10 super(true);
11 this.registerRequiredCSS('resources/appManifestView.css'); 11 this.registerRequiredCSS('resources/appManifestView.css');
12 12
13 this._reportView = new UI.ReportView(Common.UIString('App Manifest')); 13 this._reportView = new UI.ReportView(Common.UIString('App Manifest'));
14 this._reportView.show(this.contentElement); 14 this._reportView.show(this.contentElement);
15 15
16 this._errorsSection = this._reportView.appendSection(Common.UIString('Errors and warnings')); 16 this._errorsSection = this._reportView.appendSection(Common.UIString('Errors and warnings'));
17 this._identitySection = this._reportView.appendSection(Common.UIString('Iden tity')); 17 this._identitySection = this._reportView.appendSection(Common.UIString('Iden tity'));
18 var toolbar = this._identitySection.createToolbar(); 18 var toolbar = this._identitySection.createToolbar();
19 toolbar.renderAsLinks(); 19 toolbar.renderAsLinks();
20 var addToHomeScreen = 20 var addToHomeScreen =
21 new UI.ToolbarButton(Common.UIString('Add to homescreen'), undefined, Co mmon.UIString('Add to homescreen')); 21 new UI.ToolbarButton(Common.UIString('Add to homescreen'), undefined, Co mmon.UIString('Add to homescreen'));
22 addToHomeScreen.addEventListener(UI.ToolbarButton.Events.Click, this._addToH omescreen, this); 22 addToHomeScreen.addEventListener('click', this._addToHomescreen.bind(this));
23 toolbar.appendToolbarItem(addToHomeScreen); 23 toolbar.appendToolbarItem(addToHomeScreen);
24 24
25 this._presentationSection = this._reportView.appendSection(Common.UIString(' Presentation')); 25 this._presentationSection = this._reportView.appendSection(Common.UIString(' Presentation'));
26 this._iconsSection = this._reportView.appendSection(Common.UIString('Icons') ); 26 this._iconsSection = this._reportView.appendSection(Common.UIString('Icons') );
27 27
28 this._nameField = this._identitySection.appendField(Common.UIString('Name')) ; 28 this._nameField = this._identitySection.appendField(Common.UIString('Name')) ;
29 this._shortNameField = this._identitySection.appendField(Common.UIString('Sh ort name')); 29 this._shortNameField = this._identitySection.appendField(Common.UIString('Sh ort name'));
30 30
31 this._startURLField = this._presentationSection.appendField(Common.UIString( 'Start URL')); 31 this._startURLField = this._presentationSection.appendField(Common.UIString( 'Start URL'));
32 32
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 * @return {string} 129 * @return {string}
130 */ 130 */
131 function stringProperty(name) { 131 function stringProperty(name) {
132 var value = parsedManifest[name]; 132 var value = parsedManifest[name];
133 if (typeof value !== 'string') 133 if (typeof value !== 'string')
134 return ''; 134 return '';
135 return value; 135 return value;
136 } 136 }
137 } 137 }
138 138
139 /** 139 _addToHomescreen() {
140 * @param {!Common.Event} event
141 */
142 _addToHomescreen(event) {
143 var target = SDK.targetManager.mainTarget(); 140 var target = SDK.targetManager.mainTarget();
144 if (target && target.hasBrowserCapability()) { 141 if (target && target.hasBrowserCapability()) {
145 target.pageAgent().requestAppBanner(); 142 target.pageAgent().requestAppBanner();
146 Common.console.show(); 143 Common.console.show();
147 } 144 }
148 } 145 }
149 }; 146 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698