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

Unified Diff: remoting/webapp/app_remoting/js/feedback_consent.js

Issue 964403004: [Chromoting] Enable jscompile for AppRemoting's feedback_consent page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync/merge Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/app_remoting/html/template_feedback_consent.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/app_remoting/js/feedback_consent.js
diff --git a/remoting/webapp/app_remoting/js/feedback_consent.js b/remoting/webapp/app_remoting/js/feedback_consent.js
index 6691ed207f698f66c807b423eacebe987bcfae7a..f79237630c190d6e669de31ffa27090eca7046ad 100644
--- a/remoting/webapp/app_remoting/js/feedback_consent.js
+++ b/remoting/webapp/app_remoting/js/feedback_consent.js
@@ -15,7 +15,7 @@ var hostId = '@pending';
* @type {string} The network stats at the time the feedback consent dialog
* was shown.
*/
-var connectionStats = null;
+var connectionStats = '';
/**
* @type {string} "no" => user did not request a VM reset; "yes" => VM was
@@ -102,8 +102,8 @@ function showError() {
*/
function generateId() {
var idArray = new Uint8Array(20);
- crypto.getRandomValues(idArray);
- return btoa(String.fromCharCode.apply(null, idArray));
+ window.crypto.getRandomValues(idArray);
+ return window.btoa(String.fromCharCode.apply(null, idArray));
}
/**
@@ -123,10 +123,6 @@ function onToken(token) {
'abandonHost': 'true',
'crashServiceReportId': crashServiceReportId
};
- var headers = {
- 'Authorization': 'OAuth ' + token,
- 'Content-type': 'application/json'
- };
var uri = remoting.settings.APP_REMOTING_API_BASE_URL +
'/applications/' + remoting.settings.getAppRemotingApplicationId() +
'/hosts/' + hostId +
@@ -139,7 +135,13 @@ function onToken(token) {
showError();
}
};
- remoting.xhr.post(uri, onDone, JSON.stringify(body), headers);
+ remoting.xhr.start({
+ method: 'POST',
+ url: uri,
+ onDone: onDone,
+ jsonContent: body,
+ oauthToken: token
+ });
} else {
getUserInfo();
}
@@ -184,6 +186,7 @@ function onToggleLogs() {
}
}
+/** @param {Event} event */
function onLearnMore(event) {
event.preventDefault(); // Clicking the link should not tick the checkbox.
var learnMoreLink = document.getElementById('learn-more');
« no previous file with comments | « remoting/webapp/app_remoting/html/template_feedback_consent.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698