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

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 6 years 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 05e0427c83b86992e5a5618471e42f2b9e48c9dc..7b4c2ce73652f22d2e714cd34f4eec53178fd85c 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 {
@@ -44,15 +44,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
Bernhard Bauer 2014/12/17 17:05:17 Document the parameter please.
khannan 2014/12/17 17:39:09 I tried emulating a bad js file so did not know ho
*/
-function updateAfterRequestSent() {
+function requestStatus(isSuccessful) {
Bernhard Bauer 2014/12/17 17:05:17 Name this method so it's in imperative?
khannan 2014/12/17 17:39:09 Done.
$('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