| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 2903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2914 bool replace) { | 2914 bool replace) { |
| 2915 // We only show alternate error pages in the main frame. They are | 2915 // We only show alternate error pages in the main frame. They are |
| 2916 // intended to assist the user when navigating, so there is not much | 2916 // intended to assist the user when navigating, so there is not much |
| 2917 // value in showing them for failed subframes. Ideally, we would be | 2917 // value in showing them for failed subframes. Ideally, we would be |
| 2918 // able to use the TYPED transition type for this, but that flag is | 2918 // able to use the TYPED transition type for this, but that flag is |
| 2919 // not preserved across page reloads. | 2919 // not preserved across page reloads. |
| 2920 if (frame->GetParent()) | 2920 if (frame->GetParent()) |
| 2921 return false; | 2921 return false; |
| 2922 | 2922 |
| 2923 // Use the alternate error page service if this is a DNS failure or | 2923 // Use the alternate error page service if this is a DNS failure or |
| 2924 // connection failure. ERR_CONNECTION_FAILED can be dropped once we no | 2924 // connection failure. |
| 2925 // longer use winhttp. | |
| 2926 int ec = error.reason; | 2925 int ec = error.reason; |
| 2927 if (ec != net::ERR_NAME_NOT_RESOLVED && | 2926 if (ec != net::ERR_NAME_NOT_RESOLVED && |
| 2928 ec != net::ERR_CONNECTION_FAILED && | 2927 ec != net::ERR_CONNECTION_FAILED && |
| 2929 ec != net::ERR_CONNECTION_REFUSED && | 2928 ec != net::ERR_CONNECTION_REFUSED && |
| 2930 ec != net::ERR_ADDRESS_UNREACHABLE && | 2929 ec != net::ERR_ADDRESS_UNREACHABLE && |
| 2931 ec != net::ERR_TIMED_OUT) | 2930 ec != net::ERR_CONNECTION_TIMED_OUT) |
| 2932 return false; | 2931 return false; |
| 2933 | 2932 |
| 2934 const GURL& error_page_url = GetAlternateErrorPageURL(error.unreachableURL, | 2933 const GURL& error_page_url = GetAlternateErrorPageURL(error.unreachableURL, |
| 2935 ec == net::ERR_NAME_NOT_RESOLVED ? DNS_ERROR : CONNECTION_ERROR); | 2934 ec == net::ERR_NAME_NOT_RESOLVED ? DNS_ERROR : CONNECTION_ERROR); |
| 2936 if (!error_page_url.is_valid()) | 2935 if (!error_page_url.is_valid()) |
| 2937 return false; | 2936 return false; |
| 2938 | 2937 |
| 2939 // Load an empty page first so there is an immediate response to the error, | 2938 // Load an empty page first so there is an immediate response to the error, |
| 2940 // and then kick off a request for the alternate error page. | 2939 // and then kick off a request for the alternate error page. |
| 2941 frame->LoadHTMLString(std::string(), | 2940 frame->LoadHTMLString(std::string(), |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3266 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); | 3265 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); |
| 3267 } | 3266 } |
| 3268 | 3267 |
| 3269 void RenderView::Print(WebFrame* frame, bool script_initiated) { | 3268 void RenderView::Print(WebFrame* frame, bool script_initiated) { |
| 3270 DCHECK(frame); | 3269 DCHECK(frame); |
| 3271 if (print_helper_.get() == NULL) { | 3270 if (print_helper_.get() == NULL) { |
| 3272 print_helper_.reset(new PrintWebViewHelper(this)); | 3271 print_helper_.reset(new PrintWebViewHelper(this)); |
| 3273 } | 3272 } |
| 3274 print_helper_->Print(frame, script_initiated); | 3273 print_helper_->Print(frame, script_initiated); |
| 3275 } | 3274 } |
| OLD | NEW |