| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 3621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3632 // from being dumb, WebCore doesn't expect it and it will cause a crash. | 3632 // from being dumb, WebCore doesn't expect it and it will cause a crash. |
| 3633 if (error.reason == net::ERR_ABORTED) | 3633 if (error.reason == net::ERR_ABORTED) |
| 3634 return; | 3634 return; |
| 3635 | 3635 |
| 3636 // Don't display "client blocked" error page if browser has asked us not to. | 3636 // Don't display "client blocked" error page if browser has asked us not to. |
| 3637 if (error.reason == net::ERR_BLOCKED_BY_CLIENT && | 3637 if (error.reason == net::ERR_BLOCKED_BY_CLIENT && |
| 3638 renderer_preferences_.disable_client_blocked_error_page) { | 3638 renderer_preferences_.disable_client_blocked_error_page) { |
| 3639 return; | 3639 return; |
| 3640 } | 3640 } |
| 3641 | 3641 |
| 3642 if (RenderThreadImpl::current()->layout_test_mode()) | 3642 // Allow the embedder to suppress an error page. |
| 3643 if (GetContentClient()->renderer()->ShouldSuppressErrorPage( |
| 3644 error.unreachableURL)) { |
| 3643 return; | 3645 return; |
| 3646 } |
| 3647 |
| 3648 if (RenderThreadImpl::current() && |
| 3649 RenderThreadImpl::current()->layout_test_mode()) { |
| 3650 return; |
| 3651 } |
| 3644 | 3652 |
| 3645 // Make sure we never show errors in view source mode. | 3653 // Make sure we never show errors in view source mode. |
| 3646 frame->enableViewSourceMode(false); | 3654 frame->enableViewSourceMode(false); |
| 3647 | 3655 |
| 3648 DocumentState* document_state = DocumentState::FromDataSource(ds); | 3656 DocumentState* document_state = DocumentState::FromDataSource(ds); |
| 3649 NavigationState* navigation_state = document_state->navigation_state(); | 3657 NavigationState* navigation_state = document_state->navigation_state(); |
| 3650 | 3658 |
| 3651 // If this is a failed back/forward/reload navigation, then we need to do a | 3659 // If this is a failed back/forward/reload navigation, then we need to do a |
| 3652 // 'replace' load. This is necessary to avoid messing up session history. | 3660 // 'replace' load. This is necessary to avoid messing up session history. |
| 3653 // Otherwise, we do a normal load, which simulates a 'go' navigation as far | 3661 // Otherwise, we do a normal load, which simulates a 'go' navigation as far |
| (...skipping 2850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6504 for (size_t i = 0; i < icon_urls.size(); i++) { | 6512 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6505 WebURL url = icon_urls[i].iconURL(); | 6513 WebURL url = icon_urls[i].iconURL(); |
| 6506 if (!url.isEmpty()) | 6514 if (!url.isEmpty()) |
| 6507 urls.push_back(FaviconURL(url, | 6515 urls.push_back(FaviconURL(url, |
| 6508 ToFaviconType(icon_urls[i].iconType()))); | 6516 ToFaviconType(icon_urls[i].iconType()))); |
| 6509 } | 6517 } |
| 6510 SendUpdateFaviconURL(urls); | 6518 SendUpdateFaviconURL(urls); |
| 6511 } | 6519 } |
| 6512 | 6520 |
| 6513 } // namespace content | 6521 } // namespace content |
| OLD | NEW |