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

Unified Diff: chrome/renderer/net/error_page_helper_functions.h

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: Minor tweaks from self-review. 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/net/error_page_helper_functions.h
diff --git a/chrome/renderer/net/error_cache_load.h b/chrome/renderer/net/error_page_helper_functions.h
similarity index 57%
rename from chrome/renderer/net/error_cache_load.h
rename to chrome/renderer/net/error_page_helper_functions.h
index 1bb60c2722bdcc31e50528956406eebe1f86f4d8..b1fcfd74e6324f6ce688195290d6530c455c32d4 100644
--- a/chrome/renderer/net/error_cache_load.h
+++ b/chrome/renderer/net/error_page_helper_functions.h
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_RENDERER_NET_ERROR_CACHE_LOAD_H_
-#define CHROME_RENDERER_NET_ERROR_CACHE_LOAD_H_
+#ifndef CHROME_RENDERER_NET_ERROR_PAGE_HELPER_FUNCTIONS_H_
+#define CHROME_RENDERER_NET_ERROR_PAGE_HELPER_FUNCTIONS_H_
#include "base/basictypes.h"
#include "content/public/renderer/render_frame_observer.h"
#include "gin/wrappable.h"
#include "url/gurl.h"
-// ErrorCacheLoad class:
+// ErrorPageHelperFunctions class:
//
// This class makes cache loading operations available to the
// error page loaded by NetErrorHelper. It is bound to the javascript
@@ -22,28 +22,35 @@ namespace content {
class RenderFrame;
}
-class ErrorCacheLoad : public gin::Wrappable<ErrorCacheLoad>,
- public content::RenderFrameObserver {
+class ErrorPageHelperFunctions
mmenke 2014/04/09 15:59:26 Think NetErrorHelperFunctions to be more consisten
mmenke 2014/04/09 15:59:26 Think this is worth a comment (Error pages functio
Randy Smith (Not in Mondays) 2014/04/10 21:51:01 Done.
Randy Smith (Not in Mondays) 2014/04/10 21:51:01 Done.
+ : public gin::Wrappable<ErrorPageHelperFunctions>,
+ public content::RenderFrameObserver {
public:
static gin::WrapperInfo kWrapperInfo;
static void Install(content::RenderFrame* render_frame, const GURL& page_url);
private:
- ErrorCacheLoad(content::RenderFrame* render_frame, const GURL& page_url);
- virtual ~ErrorCacheLoad();
+ ErrorPageHelperFunctions(content::RenderFrame* render_frame,
+ const GURL& page_url);
+ virtual ~ErrorPageHelperFunctions();
- // Loads the original URL associated with the frame, with the blink
- // ReturnCacheDataDontLoad flag set to make sure that the value is
- // only gotten from cache.
- bool ReloadStaleInstance();
+ // Execute a "Load Stale" button click.
+ bool LoadStaleButtonClick();
+
+ // Execute a "Reload" button click.
+ bool ReloadButtonClick();
+
+ // Execute a "More" button click.
+ bool MoreButtonClick();
// gin::WrappableBase
virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) OVERRIDE;
// RenderFrameObserver. Overridden to avoid being destroyed when RenderFrame
- // goes away; ErrorCacheLoad objects are owned by the JS garbage collector.
+ // goes away; ErrorPageHelperFunctions objects are owned by the JS
+ // garbage collector.
virtual void OnDestruct() OVERRIDE;
// We'll be torn down by V8 when the page goes away, so it's safe to hold
@@ -54,7 +61,7 @@ class ErrorCacheLoad : public gin::Wrappable<ErrorCacheLoad>,
bool render_frame_destroyed_;
mmenke 2014/04/09 15:59:26 Not used.
Randy Smith (Not in Mondays) 2014/04/10 21:51:01 Done.
- DISALLOW_COPY_AND_ASSIGN(ErrorCacheLoad);
+ DISALLOW_COPY_AND_ASSIGN(ErrorPageHelperFunctions);
};
-#endif // CHROME_RENDERER_NET_ERROR_CACHE_LOAD_H_
+#endif // CHROME_RENDERER_NET_ERROR_PAGE_HELPER_FUNCTIONS_H_

Powered by Google App Engine
This is Rietveld 408576698