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

Unified Diff: chrome/renderer/resources/neterror.js

Issue 207553008: Surface button for loading stale cache copy on net error page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix incorrect spelling of iOS. Created 6 years, 8 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
Index: chrome/renderer/resources/neterror.js
diff --git a/chrome/renderer/resources/neterror.js b/chrome/renderer/resources/neterror.js
index 6f1e60198071553bf9890c4d39adb4a41bdee403..d1f4c5fe3518ff408e4543ba942298d4a4e8b4fc 100644
--- a/chrome/renderer/resources/neterror.js
+++ b/chrome/renderer/resources/neterror.js
@@ -60,13 +60,38 @@ function search(baseSearchUrl) {
return false;
}
+// Implements button clicks. This function is needed during the transition
+// between implementing these in trunk chromium and implementing them in
+// iOS.
+function reloadButtonClick(url) {
+ if (window.errorPageController) {
+ errorPageController.reloadButtonClick();
+ } else {
+ location = url;
+ }
+}
+
+function loadStaleButtonClick() {
+ if (window.errorPageController) {
+ errorPageController.loadStaleButtonClick();
+ }
jar (doing other things) 2014/04/21 23:48:19 nit: No need for curlies (per style used in this f
Randy Smith (Not in Mondays) 2014/04/22 20:40:02 Done.
+}
+
+function moreButtonClick() {
+ if (window.errorPageController) {
+ errorPageController.moreButtonClick();
+ }
+}
+
<if expr="is_macosx or is_ios or is_linux or is_android">
// Re-orders buttons. Used on Mac, Linux, and Android, where reload should go
// on the right.
function swapButtonOrder() {
- reloadButton = document.getElementById('reload-button');
- moreLessButton = document.getElementById('more-less-button');
+ var reloadButton = document.getElementById('reload-button');
+ var moreLessButton = document.getElementById('more-less-button');
+ var staleLoadButton = document.getElementById('stale-load-button');
reloadButton.parentNode.insertBefore(moreLessButton, reloadButton);
+ reloadButton.parentNode.insertBefore(staleLoadButton, reloadButton)
}
document.addEventListener("DOMContentLoaded", swapButtonOrder);
</if>
« chrome/renderer/net/net_error_page_controller.cc ('K') | « chrome/renderer/resources/neterror.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698