| Index: chrome/renderer/resources/offline.js
|
| diff --git a/chrome/renderer/resources/offline.js b/chrome/renderer/resources/offline.js
|
| index 75404cc9e2618a33a09e5db79240f20345c2374d..5fabe448cf567c1a09b82eef58a5c1933fffa751 100644
|
| --- a/chrome/renderer/resources/offline.js
|
| +++ b/chrome/renderer/resources/offline.js
|
| @@ -61,7 +61,12 @@ function Runner(outerContainerId, opt_config) {
|
| // Images.
|
| this.images = {};
|
| this.imagesLoaded = 0;
|
| - this.loadImages();
|
| +
|
| + if (this.isDisabled()) {
|
| + this.setupDisabledRunner();
|
| + } else {
|
| + this.loadImages();
|
| + }
|
| }
|
| window['Runner'] = Runner;
|
|
|
| @@ -135,6 +140,8 @@ Runner.classes = {
|
| CONTAINER: 'runner-container',
|
| CRASHED: 'crashed',
|
| ICON: 'icon-offline',
|
| + SNACKBAR: 'snackbar',
|
| + SNACKBAR_SHOW: 'snackbar-show',
|
| TOUCH_CONTROLLER: 'controller'
|
| };
|
|
|
| @@ -210,6 +217,32 @@ Runner.events = {
|
|
|
| Runner.prototype = {
|
| /**
|
| + * Whether the easter egg has been disabled. CrOS enterprise enrolled devices.
|
| + * @return {boolean}
|
| + */
|
| + isDisabled: function() {
|
| + return loadTimeData && loadTimeData.valueExists('disabledEasterEgg');
|
| + },
|
| +
|
| + /**
|
| + * For disabled instances, set up a snackbar with the disabled message.
|
| + */
|
| + setupDisabledRunner: function() {
|
| + this.containerEl = document.createElement('div');
|
| + this.containerEl.className = Runner.classes.SNACKBAR;
|
| + this.containerEl.textContent = loadTimeData.getValue('disabledEasterEgg');
|
| + this.outerContainerEl.appendChild(this.containerEl);
|
| +
|
| + // Show notification when the activation key is pressed.
|
| + document.addEventListener(Runner.events.KEYDOWN, function(e) {
|
| + if (Runner.keycodes.JUMP[e.keyCode]) {
|
| + this.containerEl.classList.add(Runner.classes.SNACKBAR_SHOW);
|
| + document.querySelector('.icon').classList.add('icon-disabled');
|
| + }
|
| + }.bind(this));
|
| + },
|
| +
|
| + /**
|
| * Setting individual settings for debugging.
|
| * @param {string} setting
|
| * @param {*} value
|
|
|