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

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

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

Powered by Google App Engine
This is Rietveld 408576698