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

Unified Diff: components/neterror/resources/offline.js

Issue 2144933002: Fix the T-Rex easter egg on iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed indent Created 4 years, 5 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 | « no previous file | ios/web/web_state/web_view_internal_creation_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/neterror/resources/offline.js
diff --git a/components/neterror/resources/offline.js b/components/neterror/resources/offline.js
index 005f4f3ae20dc570369df092d783a9e5bfec0e13..32ecc66372a30ca8c700f2c523d6623b2a254ddb 100644
--- a/components/neterror/resources/offline.js
+++ b/components/neterror/resources/offline.js
@@ -292,7 +292,13 @@ Runner.prototype = {
this.spriteDef = Runner.spriteDefinition.LDPI;
}
- this.init();
+ if (Runner.imageSprite.complete) {
+ this.init();
+ } else {
+ // If the images are not yet loaded, add a listener.
+ Runner.imageSprite.addEventListener(Runner.events.LOAD,
+ this.init.bind(this));
+ }
},
/**
@@ -660,7 +666,9 @@ Runner.prototype = {
if (!this.activated) {
this.loadSounds();
this.activated = true;
- errorPageController.trackEasterEgg();
+ if (window.errorPageController) {
+ errorPageController.trackEasterEgg();
+ }
}
if (!this.tRex.jumping && !this.tRex.ducking) {
« no previous file with comments | « no previous file | ios/web/web_state/web_view_internal_creation_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698