Chromium Code Reviews| Index: components/supervised_user_error_page/resources/supervised_user_block_interstitial.js |
| diff --git a/components/supervised_user_error_page/resources/supervised_user_block_interstitial.js b/components/supervised_user_error_page/resources/supervised_user_block_interstitial.js |
| index ca0bbec39b1d338a5bcf2b066d095658be9afc5a..3374af9235b99068aa01a79b502232d53139d24d 100644 |
| --- a/components/supervised_user_error_page/resources/supervised_user_block_interstitial.js |
| +++ b/components/supervised_user_error_page/resources/supervised_user_block_interstitial.js |
| @@ -15,7 +15,11 @@ function initialize() { |
| if (loadTimeData.getBoolean('allowAccessRequests')) { |
| $('request-access-button').onclick = function(event) { |
| $('request-access-button').hidden = true; |
| - sendCommand('request'); |
| + if (window.domAutomationController) { |
| + sendCommand('request'); |
| + } else { |
| + window.webRestrictions.requestPermission(); |
| + } |
| }; |
| } else { |
| $('request-access-button').hidden = true; |
| @@ -49,9 +53,11 @@ function initialize() { |
| var showDetailsLink = loadTimeData.getString('showDetailsLink'); |
| $('show-details-link').hidden = !showDetailsLink; |
| $('back-button').hidden = showDetailsLink; |
|
Bernhard Bauer
2016/04/18 14:48:34
Do we want to hide the back button in this case?
aberent
2016/05/18 20:06:50
Done.
|
| - $('back-button').onclick = function(event) { |
| - sendCommand('back'); |
| - }; |
| + if (window.domAutomationController) { |
| + $('back-button').onclick = function(event) { |
| + sendCommand('back'); |
| + }; |
| + } |
| $('show-details-link').onclick = function(event) { |
| $('details').hidden = false; |
| $('show-details-link').hidden = true; |
| @@ -66,7 +72,8 @@ function initialize() { |
| $('information-container').classList.remove('hidden-on-mobile'); |
| $('request-access-button').classList.remove('hidden-on-mobile'); |
| }; |
| - if (loadTimeData.getBoolean('showFeedbackLink')) { |
| + if (window.domAutomationController && |
|
Bernhard Bauer
2016/04/18 14:48:34
Not sure this is necessary -- just don't set 'show
aberent
2016/05/18 20:06:49
We could do, but the code that sets 'showFeedbackL
|
| + loadTimeData.getBoolean('showFeedbackLink')) { |
| $('feedback-link').onclick = function(event) { |
| sendCommand('feedback'); |
| }; |