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

Unified Diff: chrome/browser/resources/supervised_user_block_interstitial.js

Issue 789703004: Reflect the status of a request for accessing a blacklisted url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
Index: chrome/browser/resources/supervised_user_block_interstitial.js
diff --git a/chrome/browser/resources/supervised_user_block_interstitial.js b/chrome/browser/resources/supervised_user_block_interstitial.js
index 1152839a91147df835509d420fdb6bc7337c4ec8..55b652c34a4360d2f894836240ffb85b648285bb 100644
--- a/chrome/browser/resources/supervised_user_block_interstitial.js
+++ b/chrome/browser/resources/supervised_user_block_interstitial.js
@@ -14,7 +14,7 @@ function makeImageSet(url1x, url2x) {
function initialize() {
if (loadTimeData.getBoolean('allowAccessRequests')) {
$('request-access-button').onclick = function(event) {
- updateAfterRequestSent();
+ $('request-access-button').hidden = true;
sendCommand('request');
};
} else {
@@ -51,15 +51,21 @@ function initialize() {
}
/**
- * Updates the interstitial to show that the request was sent.
+ * Updates the interstitial to show that the request failed or was sent.
+ * @param {boolean} isSuccessful Whether the request was successful or not.
*/
-function updateAfterRequestSent() {
+function setRequestStatus(isSuccessful) {
$('error-img').hidden = true;
- $('request-access-button').hidden = true;
$('block-page-message').hidden = true;
- $('request-sent-message').hidden = false;
- if ($('avatar-img').hidden) {
- $('request-sent-message').style.marginTop = '40px';
+ if (isSuccessful) {
+ $('request-failed-message').hidden = true;
+ $('request-sent-message').hidden = false;
+ if ($('avatar-img').hidden) {
+ $('request-sent-message').style.marginTop = '40px';
+ }
+ } else {
+ $('request-failed-message').hidden = false;
+ $('request-access-button').hidden = false;
}
}

Powered by Google App Engine
This is Rietveld 408576698