Chromium Code Reviews| 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 3635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3646 params.url = error.unreachableURL; | 3646 params.url = error.unreachableURL; |
| 3647 params.showing_repost_interstitial = show_repost_interstitial; | 3647 params.showing_repost_interstitial = show_repost_interstitial; |
| 3648 Send(new ViewHostMsg_DidFailProvisionalLoadWithError( | 3648 Send(new ViewHostMsg_DidFailProvisionalLoadWithError( |
| 3649 routing_id_, params)); | 3649 routing_id_, params)); |
| 3650 | 3650 |
| 3651 // Don't display an error page if this is simply a cancelled load. Aside | 3651 // Don't display an error page if this is simply a cancelled load. Aside |
| 3652 // from being dumb, WebCore doesn't expect it and it will cause a crash. | 3652 // from being dumb, WebCore doesn't expect it and it will cause a crash. |
| 3653 if (error.reason == net::ERR_ABORTED) | 3653 if (error.reason == net::ERR_ABORTED) |
| 3654 return; | 3654 return; |
| 3655 | 3655 |
| 3656 // Don't display "client blocked" error page if browser has asked us not to. | |
| 3657 if (error.reason == net::ERR_BLOCKED_BY_CLIENT && | |
| 3658 renderer_preferences_.disable_client_blocked_error_page) { | |
| 3659 return; | |
| 3660 } | |
| 3661 | |
| 3656 if (RenderThreadImpl::current()->layout_test_mode()) | 3662 if (RenderThreadImpl::current()->layout_test_mode()) |
| 3657 return; | 3663 return; |
| 3658 | 3664 |
| 3659 // Make sure we never show errors in view source mode. | 3665 // Make sure we never show errors in view source mode. |
| 3660 frame->enableViewSourceMode(false); | 3666 frame->enableViewSourceMode(false); |
| 3661 | 3667 |
| 3662 DocumentState* document_state = DocumentState::FromDataSource(ds); | 3668 DocumentState* document_state = DocumentState::FromDataSource(ds); |
| 3663 NavigationState* navigation_state = document_state->navigation_state(); | 3669 NavigationState* navigation_state = document_state->navigation_state(); |
| 3664 | 3670 |
| 3665 // If this is a failed back/forward/reload navigation, then we need to do a | 3671 // If this is a failed back/forward/reload navigation, then we need to do a |
| 3666 // 'replace' load. This is necessary to avoid messing up session history. | 3672 // 'replace' load. This is necessary to avoid messing up session history. |
|
Charlie Reis
2013/09/03 23:14:31
I'm having trouble understanding why you want to d
Fady Samuel
2013/09/13 20:12:22
There is a desire to give <webview> developers the
Charlie Reis
2013/09/13 21:44:56
I suppose this comment mainly applies to the LoadN
| |
| 3667 // Otherwise, we do a normal load, which simulates a 'go' navigation as far | 3673 // Otherwise, we do a normal load, which simulates a 'go' navigation as far |
| 3668 // as session history is concerned. | 3674 // as session history is concerned. |
| 3669 // | 3675 // |
| 3670 // AUTO_SUBFRAME loads should always be treated as loads that do not advance | 3676 // AUTO_SUBFRAME loads should always be treated as loads that do not advance |
| 3671 // the page id. | 3677 // the page id. |
| 3672 // | 3678 // |
| 3673 bool replace = | 3679 bool replace = |
| 3674 navigation_state->pending_page_id() != -1 || | 3680 navigation_state->pending_page_id() != -1 || |
| 3675 PageTransitionCoreTypeIs(navigation_state->transition_type(), | 3681 PageTransitionCoreTypeIs(navigation_state->transition_type(), |
| 3676 PAGE_TRANSITION_AUTO_SUBFRAME); | 3682 PAGE_TRANSITION_AUTO_SUBFRAME); |
| (...skipping 2845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6522 for (size_t i = 0; i < icon_urls.size(); i++) { | 6528 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6523 WebURL url = icon_urls[i].iconURL(); | 6529 WebURL url = icon_urls[i].iconURL(); |
| 6524 if (!url.isEmpty()) | 6530 if (!url.isEmpty()) |
| 6525 urls.push_back(FaviconURL(url, | 6531 urls.push_back(FaviconURL(url, |
| 6526 ToFaviconType(icon_urls[i].iconType()))); | 6532 ToFaviconType(icon_urls[i].iconType()))); |
| 6527 } | 6533 } |
| 6528 SendUpdateFaviconURL(urls); | 6534 SendUpdateFaviconURL(urls); |
| 6529 } | 6535 } |
| 6530 | 6536 |
| 6531 } // namespace content | 6537 } // namespace content |
| OLD | NEW |