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 3714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3725 } | 3725 } |
3726 | 3726 |
3727 // Provide the user with a more helpful error page? | 3727 // Provide the user with a more helpful error page? |
3728 if (MaybeLoadAlternateErrorPage(frame, error, replace)) | 3728 if (MaybeLoadAlternateErrorPage(frame, error, replace)) |
3729 return; | 3729 return; |
3730 | 3730 |
3731 // Fallback to a local error page. | 3731 // Fallback to a local error page. |
3732 LoadNavigationErrorPage(frame, failed_request, error, std::string(), replace); | 3732 LoadNavigationErrorPage(frame, failed_request, error, std::string(), replace); |
3733 } | 3733 } |
3734 | 3734 |
3735 void RenderViewImpl::didReceiveDocumentData( | |
3736 WebFrame* frame, const char* data, size_t data_len, | |
3737 bool& prevent_default) { | |
3738 InternalDocumentStateData* internal_data = | |
3739 InternalDocumentStateData::FromDataSource(frame->dataSource()); | |
3740 internal_data->set_use_error_page(false); | |
3741 } | |
3742 | |
3743 void RenderViewImpl::didCommitProvisionalLoad(WebFrame* frame, | 3735 void RenderViewImpl::didCommitProvisionalLoad(WebFrame* frame, |
3744 bool is_new_navigation) { | 3736 bool is_new_navigation) { |
3745 DocumentState* document_state = | 3737 DocumentState* document_state = |
3746 DocumentState::FromDataSource(frame->dataSource()); | 3738 DocumentState::FromDataSource(frame->dataSource()); |
3747 NavigationState* navigation_state = document_state->navigation_state(); | 3739 NavigationState* navigation_state = document_state->navigation_state(); |
3748 InternalDocumentStateData* internal_data = | 3740 InternalDocumentStateData* internal_data = |
3749 InternalDocumentStateData::FromDocumentState(document_state); | 3741 InternalDocumentStateData::FromDocumentState(document_state); |
3750 | 3742 |
3751 if (document_state->commit_load_time().is_null()) | 3743 if (document_state->commit_load_time().is_null()) |
3752 document_state->set_commit_load_time(Time::Now()); | 3744 document_state->set_commit_load_time(Time::Now()); |
3753 | 3745 |
3754 if (internal_data->must_reset_scroll_and_scale_state()) { | 3746 if (internal_data->must_reset_scroll_and_scale_state()) { |
3755 webview()->resetScrollAndScaleState(); | 3747 webview()->resetScrollAndScaleState(); |
3756 internal_data->set_must_reset_scroll_and_scale_state(false); | 3748 internal_data->set_must_reset_scroll_and_scale_state(false); |
3757 } | 3749 } |
| 3750 internal_data->set_use_error_page(false); |
3758 | 3751 |
3759 if (is_new_navigation) { | 3752 if (is_new_navigation) { |
3760 // When we perform a new navigation, we need to update the last committed | 3753 // When we perform a new navigation, we need to update the last committed |
3761 // session history entry with state for the page we are leaving. | 3754 // session history entry with state for the page we are leaving. |
3762 UpdateSessionHistory(frame); | 3755 UpdateSessionHistory(frame); |
3763 | 3756 |
3764 // We bump our Page ID to correspond with the new session history entry. | 3757 // We bump our Page ID to correspond with the new session history entry. |
3765 page_id_ = next_page_id_++; | 3758 page_id_ = next_page_id_++; |
3766 | 3759 |
3767 // Don't update history_page_ids_ (etc) for kSwappedOutURL, since | 3760 // Don't update history_page_ids_ (etc) for kSwappedOutURL, since |
(...skipping 3039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6807 WebURL url = icon_urls[i].iconURL(); | 6800 WebURL url = icon_urls[i].iconURL(); |
6808 if (!url.isEmpty()) | 6801 if (!url.isEmpty()) |
6809 urls.push_back(FaviconURL(url, | 6802 urls.push_back(FaviconURL(url, |
6810 ToFaviconType(icon_urls[i].iconType()))); | 6803 ToFaviconType(icon_urls[i].iconType()))); |
6811 } | 6804 } |
6812 SendUpdateFaviconURL(urls); | 6805 SendUpdateFaviconURL(urls); |
6813 } | 6806 } |
6814 | 6807 |
6815 | 6808 |
6816 } // namespace content | 6809 } // namespace content |
OLD | NEW |