OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 |
| 5 #ifndef CHROME_RENDERER_NET_NET_ERROR_PAGE_CONTROLLER_H_ |
| 6 #define CHROME_RENDERER_NET_NET_ERROR_PAGE_CONTROLLER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "content/public/renderer/render_frame_observer.h" |
| 10 #include "gin/wrappable.h" |
| 11 |
| 12 |
| 13 namespace content { |
| 14 class RenderFrame; |
| 15 } |
| 16 |
| 17 // This class makes various helper functions available to the |
| 18 // error page loaded by NetErrorHelper. It is bound to the JavaScript |
| 19 // window.errorPageController object. |
| 20 class NetErrorPageController |
| 21 : public gin::Wrappable<NetErrorPageController>, |
| 22 public content::RenderFrameObserver { |
| 23 public: |
| 24 static gin::WrapperInfo kWrapperInfo; |
| 25 |
| 26 static void Install(content::RenderFrame* render_frame); |
| 27 |
| 28 private: |
| 29 explicit NetErrorPageController(content::RenderFrame* render_frame); |
| 30 virtual ~NetErrorPageController(); |
| 31 |
| 32 // Execute a "Load Stale" button click. |
| 33 bool LoadStaleButtonClick(); |
| 34 |
| 35 // Execute a "Reload" button click. |
| 36 bool ReloadButtonClick(); |
| 37 |
| 38 // Execute a "More" button click. |
| 39 bool MoreButtonClick(); |
| 40 |
| 41 // gin::WrappableBase |
| 42 virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder( |
| 43 v8::Isolate* isolate) OVERRIDE; |
| 44 |
| 45 // RenderFrameObserver. Overridden to avoid being destroyed when RenderFrame |
| 46 // goes away; NetErrorPageController objects are owned by the JS |
| 47 // garbage collector. |
| 48 virtual void OnDestruct() OVERRIDE; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(NetErrorPageController); |
| 51 }; |
| 52 |
| 53 #endif // CHROME_RENDERER_NET_NET_ERROR_PAGE_CONTROLLER_H_ |
OLD | NEW |