OLD | NEW |
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 | |
13 /** | 12 /** |
14 * Populates the feedback form with data. | 13 * Populates the feedback form with data. |
15 * | 14 * |
16 * @param {{email: (string|undefined), | 15 * @param {{email: (string|undefined), |
17 * url: (string|undefined)}} data | 16 * url: (string|undefined)}} data |
18 * Parameters in data: | 17 * Parameters in data: |
19 * email - user's email, if available. | 18 * email - user's email, if available. |
20 * url - url of the tab the user was on before triggering feedback. | 19 * url - url of the tab the user was on before triggering feedback. |
21 */ | 20 */ |
22 static setData(data) { | 21 static setData(data) { |
(...skipping 11 matching lines...) Expand all Loading... |
34 * The data will be returned via Feedback.UI.setData. | 33 * The data will be returned via Feedback.UI.setData. |
35 */ | 34 */ |
36 static requestData() { | 35 static requestData() { |
37 chrome.send('requestData'); | 36 chrome.send('requestData'); |
38 } | 37 } |
39 }; | 38 }; |
40 | 39 |
41 window.addEventListener('DOMContentLoaded', function() { | 40 window.addEventListener('DOMContentLoaded', function() { |
42 Feedback.BrowserApi.requestData(); | 41 Feedback.BrowserApi.requestData(); |
43 }); | 42 }); |
OLD | NEW |