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 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1956 } | 1956 } |
1957 | 1957 |
1958 // If the page contained a client redirect (meta refresh, document.loc...), | 1958 // If the page contained a client redirect (meta refresh, document.loc...), |
1959 // set the referrer and transition appropriately. | 1959 // set the referrer and transition appropriately. |
1960 if (ds->isClientRedirect()) { | 1960 if (ds->isClientRedirect()) { |
1961 params.referrer = Referrer(params.redirects[0], | 1961 params.referrer = Referrer(params.redirects[0], |
1962 GetReferrerPolicyFromRequest(frame, ds->request())); | 1962 GetReferrerPolicyFromRequest(frame, ds->request())); |
1963 params.transition = static_cast<PageTransition>( | 1963 params.transition = static_cast<PageTransition>( |
1964 params.transition | PAGE_TRANSITION_CLIENT_REDIRECT); | 1964 params.transition | PAGE_TRANSITION_CLIENT_REDIRECT); |
1965 } else { | 1965 } else { |
1966 // Bug 654101: the referrer will be empty on https->http transitions. It | 1966 params.referrer = GetReferrerFromRequest(frame, ds->request()); |
1967 // would be nice if we could get the real referrer from somewhere. | |
1968 params.referrer = GetReferrerFromRequest(frame, original_request); | |
1969 } | 1967 } |
1970 | 1968 |
1971 base::string16 method = request.httpMethod(); | 1969 base::string16 method = request.httpMethod(); |
1972 if (EqualsASCII(method, "POST")) { | 1970 if (EqualsASCII(method, "POST")) { |
1973 params.is_post = true; | 1971 params.is_post = true; |
1974 params.post_id = ExtractPostId(item); | 1972 params.post_id = ExtractPostId(item); |
1975 } | 1973 } |
1976 | 1974 |
1977 // Send the user agent override back. | 1975 // Send the user agent override back. |
1978 params.is_overriding_user_agent = internal_data->is_overriding_user_agent(); | 1976 params.is_overriding_user_agent = internal_data->is_overriding_user_agent(); |
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3580 InternalDocumentStateData::FromDocumentState(document_state); | 3578 InternalDocumentStateData::FromDocumentState(document_state); |
3581 | 3579 |
3582 if (document_state->commit_load_time().is_null()) | 3580 if (document_state->commit_load_time().is_null()) |
3583 document_state->set_commit_load_time(Time::Now()); | 3581 document_state->set_commit_load_time(Time::Now()); |
3584 | 3582 |
3585 if (internal_data->must_reset_scroll_and_scale_state()) { | 3583 if (internal_data->must_reset_scroll_and_scale_state()) { |
3586 webview()->resetScrollAndScaleState(); | 3584 webview()->resetScrollAndScaleState(); |
3587 internal_data->set_must_reset_scroll_and_scale_state(false); | 3585 internal_data->set_must_reset_scroll_and_scale_state(false); |
3588 } | 3586 } |
3589 internal_data->set_use_error_page(false); | 3587 internal_data->set_use_error_page(false); |
| 3588 internal_data->clear_referrer_policy(); |
3590 | 3589 |
3591 if (is_new_navigation) { | 3590 if (is_new_navigation) { |
3592 // When we perform a new navigation, we need to update the last committed | 3591 // When we perform a new navigation, we need to update the last committed |
3593 // session history entry with state for the page we are leaving. | 3592 // session history entry with state for the page we are leaving. |
3594 UpdateSessionHistory(frame); | 3593 UpdateSessionHistory(frame); |
3595 | 3594 |
3596 // We bump our Page ID to correspond with the new session history entry. | 3595 // We bump our Page ID to correspond with the new session history entry. |
3597 page_id_ = next_page_id_++; | 3596 page_id_ = next_page_id_++; |
3598 | 3597 |
3599 // Don't update history_page_ids_ (etc) for kSwappedOutURL, since | 3598 // Don't update history_page_ids_ (etc) for kSwappedOutURL, since |
(...skipping 2784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6384 for (size_t i = 0; i < icon_urls.size(); i++) { | 6383 for (size_t i = 0; i < icon_urls.size(); i++) { |
6385 WebURL url = icon_urls[i].iconURL(); | 6384 WebURL url = icon_urls[i].iconURL(); |
6386 if (!url.isEmpty()) | 6385 if (!url.isEmpty()) |
6387 urls.push_back(FaviconURL(url, | 6386 urls.push_back(FaviconURL(url, |
6388 ToFaviconType(icon_urls[i].iconType()))); | 6387 ToFaviconType(icon_urls[i].iconType()))); |
6389 } | 6388 } |
6390 SendUpdateFaviconURL(urls); | 6389 SendUpdateFaviconURL(urls); |
6391 } | 6390 } |
6392 | 6391 |
6393 } // namespace content | 6392 } // namespace content |
OLD | NEW |