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

Side by Side Diff: chrome/browser/resources/md_feedback/feedback.js

Issue 2400173003: [MD Feedback] Add feedback to closure compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 2 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 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 var Feedback = {}; 5 var Feedback = {};
6 6
7 /** 7 /**
8 * API invoked by the browser MdFeedbackWebUIMessageHandler to communicate 8 * API invoked by the browser MdFeedbackWebUIMessageHandler to communicate
9 * with this UI. 9 * with this UI.
10 */ 10 */
11 Feedback.UI = class { 11 Feedback.UI = class {
12 12
13 /** 13 /**
14 * Populates the feedback form with data. 14 * Populates the feedback form with data.
15 * 15 *
16 * @param {{email: string|undefined, 16 * @param {{email: (string|undefined),
17 * url: string|undefined}} data 17 * url: (string|undefined)}} data
18 * Parameters in data: 18 * Parameters in data:
19 * email - user's email, if available. 19 * email - user's email, if available.
20 * url - url of the tab the user was on before triggering feedback. 20 * url - url of the tab the user was on before triggering feedback.
21 */ 21 */
22 static setData(data) { 22 static setData(data) {
23 $('container').email = data['email']; 23 $('container').email = data['email'];
24 $('container').url = data['url']; 24 $('container').url = data['url'];
25 } 25 }
26 }; 26 };
27 27
28 /** API invoked by this UI to communicate with the browser WebUI message 28 /** API invoked by this UI to communicate with the browser WebUI message
29 * handler. 29 * handler.
30 */ 30 */
31 Feedback.BrowserApi = class { 31 Feedback.BrowserApi = class {
32 /** 32 /**
33 * Requests data to initialize the WebUI with. 33 * Requests data to initialize the WebUI with.
34 * The data will be returned via Feedback.UI.setData. 34 * The data will be returned via Feedback.UI.setData.
35 */ 35 */
36 static requestData() { 36 static requestData() {
37 chrome.send('requestData'); 37 chrome.send('requestData');
38 } 38 }
39 }; 39 };
40 40
41 window.addEventListener('DOMContentLoaded', function() { 41 window.addEventListener('DOMContentLoaded', function() {
42 Feedback.BrowserApi.requestData(); 42 Feedback.BrowserApi.requestData();
43 }); 43 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_feedback/compiled_resources2.gyp ('k') | third_party/closure_compiler/compiled_resources2.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698