error_page_controller_ios.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright (c) 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. window.errorPageController = {
  5. // Execute a button click to download page later.
  6. downloadButtonClick: function() {},
  7. // Execute a click on the reload button.
  8. reloadButtonClick: function(url) {
  9. window.location = url;
  10. },
  11. // Execute a "Details" button click.
  12. detailsButtonClick: function() {},
  13. // Execute a "Diagnose Errors" button click.
  14. diagnoseErrorsButtonClick: function() {},
  15. // ???
  16. launchOfflineItem: function() {},
  17. savePageForLater: function() {},
  18. cancelSavePage: function() {},
  19. listVisibilityChange: function() {},
  20. // Track easter egg plays and high scores.
  21. trackEasterEgg: function() {
  22. __gCrWeb.message.invokeOnHost(
  23. {'command': 'errorPageController.trackEasterEgg'});
  24. },
  25. updateEasterEggHighScore: function(highScore) {
  26. __gCrWeb.message.invokeOnHost({
  27. 'command': 'errorPageController.updateEasterEggHighScore',
  28. 'highScore': highScore.toString(),
  29. });
  30. },
  31. resetEasterEggHighScore: function() {
  32. __gCrWeb.message.invokeOnHost(
  33. {'command': 'errorPageController.resetEasterEggHighScore'});
  34. },
  35. };
  36. // Create a __gCrWeb binding of initializeEasterEggHighScore so it can be
  37. // called using JS messaging.
  38. __gCrWeb.errorPageController = {};
  39. __gCrWeb['errorPageController'] = __gCrWeb.errorPageController;
  40. __gCrWeb.errorPageController['initializeEasterEggHighScore'] = function(
  41. highscore) {
  42. initializeEasterEggHighScore(highscore);
  43. };