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

Unified Diff: chrome/renderer/net/net_error_page_controller.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: 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/net/net_error_page_controller.h
diff --git a/chrome/renderer/net/net_error_page_controller.h b/chrome/renderer/net/net_error_page_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..a3a615fef2375da0f36a0ca0d6e8d378f8b2c9a2
--- /dev/null
+++ b/chrome/renderer/net/net_error_page_controller.h
@@ -0,0 +1,53 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_RENDERER_NET_NET_ERROR_PAGE_CONTROLLER_H_
+#define CHROME_RENDERER_NET_NET_ERROR_PAGE_CONTROLLER_H_
+
+#include "base/macros.h"
+#include "content/public/renderer/render_frame_observer.h"
+#include "gin/wrappable.h"
+
+
+namespace content {
+class RenderFrame;
+}
+
+// This class makes various helper functions available to the
+// error page loaded by NetErrorHelper. It is bound to the JavaScript
+// window.errorPageController object.
+class NetErrorPageController
jar (doing other things) 2014/04/21 23:48:19 nit: Should this be in the net namespace?
Randy Smith (Not in Mondays) 2014/04/22 20:40:02 I followed the model of NetErrorHelper, which isn'
mmenke 2014/04/22 21:03:27 You're correct - neither browser/net nor renderer/
jar (doing other things) 2014/04/23 01:52:01 You're correct. This is not in the src/net/... pat
+ : public gin::Wrappable<NetErrorPageController>,
+ public content::RenderFrameObserver {
+ public:
+ static gin::WrapperInfo kWrapperInfo;
+
+ static void Install(content::RenderFrame* render_frame);
+
+ private:
+ explicit NetErrorPageController(content::RenderFrame* render_frame);
+ virtual ~NetErrorPageController();
+
+ // 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; NetErrorPageController objects are owned by the JS
+ // garbage collector.
+ virtual void OnDestruct() OVERRIDE;
+
+ DISALLOW_COPY_AND_ASSIGN(NetErrorPageController);
+};
+
+#endif // CHROME_RENDERER_NET_NET_ERROR_PAGE_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698