OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2622 // TODO(nasko): Hack around asking about top-frame data source. This means | 2622 // TODO(nasko): Hack around asking about top-frame data source. This means |
2623 // for out-of-process iframes we are treating the current frame as the | 2623 // for out-of-process iframes we are treating the current frame as the |
2624 // top-level frame, which is wrong. | 2624 // top-level frame, which is wrong. |
2625 if (!top_frame || top_frame->isWebRemoteFrame()) | 2625 if (!top_frame || top_frame->isWebRemoteFrame()) |
2626 top_frame = frame; | 2626 top_frame = frame; |
2627 WebDataSource* provisional_data_source = top_frame->provisionalDataSource(); | 2627 WebDataSource* provisional_data_source = top_frame->provisionalDataSource(); |
2628 WebDataSource* top_data_source = top_frame->dataSource(); | 2628 WebDataSource* top_data_source = top_frame->dataSource(); |
2629 WebDataSource* data_source = | 2629 WebDataSource* data_source = |
2630 provisional_data_source ? provisional_data_source : top_data_source; | 2630 provisional_data_source ? provisional_data_source : top_data_source; |
2631 | 2631 |
2632 ui::PageTransition transition_type = ui::PAGE_TRANSITION_LINK; | |
2633 DocumentState* document_state = DocumentState::FromDataSource(data_source); | 2632 DocumentState* document_state = DocumentState::FromDataSource(data_source); |
2634 DCHECK(document_state); | 2633 DCHECK(document_state); |
2635 InternalDocumentStateData* internal_data = | 2634 InternalDocumentStateData* internal_data = |
2636 InternalDocumentStateData::FromDocumentState(document_state); | 2635 InternalDocumentStateData::FromDocumentState(document_state); |
2637 NavigationState* navigation_state = document_state->navigation_state(); | 2636 NavigationState* navigation_state = document_state->navigation_state(); |
2638 transition_type = navigation_state->transition_type(); | 2637 ui::PageTransition transition_type = navigation_state->transition_type(); |
| 2638 WebDataSource* frame_ds = frame->provisionalDataSource(); |
| 2639 if (frame_ds && frame_ds->isClientRedirect()) { |
| 2640 transition_type = static_cast<ui::PageTransition>( |
| 2641 transition_type | ui::PAGE_TRANSITION_CLIENT_REDIRECT); |
| 2642 CHECK(ui::PageTransitionIsValidType(transition_type)); |
| 2643 } |
2639 | 2644 |
2640 GURL request_url(request.url()); | 2645 GURL request_url(request.url()); |
2641 GURL new_url; | 2646 GURL new_url; |
2642 if (GetContentClient()->renderer()->WillSendRequest( | 2647 if (GetContentClient()->renderer()->WillSendRequest( |
2643 frame, | 2648 frame, |
2644 transition_type, | 2649 transition_type, |
2645 request_url, | 2650 request_url, |
2646 request.firstPartyForCookies(), | 2651 request.firstPartyForCookies(), |
2647 &new_url)) { | 2652 &new_url)) { |
2648 request.setURL(WebURL(new_url)); | 2653 request.setURL(WebURL(new_url)); |
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3908 | 3913 |
3909 #if defined(ENABLE_BROWSER_CDMS) | 3914 #if defined(ENABLE_BROWSER_CDMS) |
3910 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3915 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3911 if (!cdm_manager_) | 3916 if (!cdm_manager_) |
3912 cdm_manager_ = new RendererCdmManager(this); | 3917 cdm_manager_ = new RendererCdmManager(this); |
3913 return cdm_manager_; | 3918 return cdm_manager_; |
3914 } | 3919 } |
3915 #endif // defined(ENABLE_BROWSER_CDMS) | 3920 #endif // defined(ENABLE_BROWSER_CDMS) |
3916 | 3921 |
3917 } // namespace content | 3922 } // namespace content |
OLD | NEW |