OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/net/net_error_page_controller.h" | 5 #include "chrome/renderer/net/net_error_page_controller.h" |
6 | 6 |
7 #include "base/strings/string_piece.h" | 7 #include "base/strings/string_piece.h" |
8 #include "chrome/renderer/net/net_error_helper.h" | 8 #include "chrome/renderer/net/net_error_helper.h" |
9 #include "content/public/renderer/render_frame.h" | 9 #include "content/public/renderer/render_frame.h" |
10 #include "gin/handle.h" | 10 #include "gin/handle.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return false; | 53 return false; |
54 | 54 |
55 NetErrorHelper* net_error_helper = | 55 NetErrorHelper* net_error_helper = |
56 content::RenderFrameObserverTracker<NetErrorHelper>::Get(render_frame()); | 56 content::RenderFrameObserverTracker<NetErrorHelper>::Get(render_frame()); |
57 DCHECK(net_error_helper); | 57 DCHECK(net_error_helper); |
58 net_error_helper->ReloadButtonPressed(); | 58 net_error_helper->ReloadButtonPressed(); |
59 | 59 |
60 return true; | 60 return true; |
61 } | 61 } |
62 | 62 |
63 bool NetErrorPageController::MoreButtonClick() { | 63 bool NetErrorPageController::DetailsButtonClick() { |
64 if (!render_frame()) | 64 if (!render_frame()) |
65 return false; | 65 return false; |
66 | 66 |
67 NetErrorHelper* net_error_helper = | 67 NetErrorHelper* net_error_helper = |
68 content::RenderFrameObserverTracker<NetErrorHelper>::Get(render_frame()); | 68 content::RenderFrameObserverTracker<NetErrorHelper>::Get(render_frame()); |
69 DCHECK(net_error_helper); | 69 DCHECK(net_error_helper); |
70 net_error_helper->MoreButtonPressed(); | 70 net_error_helper->MoreButtonPressed(); |
71 | 71 |
72 return true; | 72 return true; |
73 } | 73 } |
(...skipping 18 matching lines...) Expand all Loading... |
92 NetErrorPageController::~NetErrorPageController() {} | 92 NetErrorPageController::~NetErrorPageController() {} |
93 | 93 |
94 gin::ObjectTemplateBuilder NetErrorPageController::GetObjectTemplateBuilder( | 94 gin::ObjectTemplateBuilder NetErrorPageController::GetObjectTemplateBuilder( |
95 v8::Isolate* isolate) { | 95 v8::Isolate* isolate) { |
96 return gin::Wrappable<NetErrorPageController>::GetObjectTemplateBuilder( | 96 return gin::Wrappable<NetErrorPageController>::GetObjectTemplateBuilder( |
97 isolate) | 97 isolate) |
98 .SetMethod("loadStaleButtonClick", | 98 .SetMethod("loadStaleButtonClick", |
99 &NetErrorPageController::LoadStaleButtonClick) | 99 &NetErrorPageController::LoadStaleButtonClick) |
100 .SetMethod("reloadButtonClick", | 100 .SetMethod("reloadButtonClick", |
101 &NetErrorPageController::ReloadButtonClick) | 101 &NetErrorPageController::ReloadButtonClick) |
102 .SetMethod("moreButtonClick", &NetErrorPageController::MoreButtonClick) | 102 .SetMethod("detailsButtonClick", |
| 103 &NetErrorPageController::DetailsButtonClick) |
103 .SetMethod("trackClick", | 104 .SetMethod("trackClick", |
104 &NetErrorPageController::TrackClick); | 105 &NetErrorPageController::TrackClick); |
105 } | 106 } |
106 | 107 |
107 void NetErrorPageController::OnDestruct() {} | 108 void NetErrorPageController::OnDestruct() {} |
OLD | NEW |