Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 576 NavigationPolicy FrameLoaderClientImpl::decidePolicyForNavigation(const Resource Request& request, DocumentLoader* loader, NavigationType type, NavigationPolicy policy, bool replacesCurrentHistoryItem) | 576 NavigationPolicy FrameLoaderClientImpl::decidePolicyForNavigation(const Resource Request& request, DocumentLoader* loader, NavigationType type, NavigationPolicy policy, bool replacesCurrentHistoryItem) |
| 577 { | 577 { |
| 578 if (!m_webFrame->client()) | 578 if (!m_webFrame->client()) |
| 579 return NavigationPolicyIgnore; | 579 return NavigationPolicyIgnore; |
| 580 | 580 |
| 581 if (policy == NavigationPolicyNewBackgroundTab && !allowCreatingBackgroundTa bs() && !UIEventWithKeyState::newTabModifierSetFromIsolatedWorld()) | 581 if (policy == NavigationPolicyNewBackgroundTab && !allowCreatingBackgroundTa bs() && !UIEventWithKeyState::newTabModifierSetFromIsolatedWorld()) |
| 582 policy = NavigationPolicyNewForegroundTab; | 582 policy = NavigationPolicyNewForegroundTab; |
| 583 | 583 |
| 584 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader(loader); | 584 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader(loader); |
| 585 | 585 |
| 586 bool isHistoryNavigationInNewChildFrame = m_webFrame->parent() | |
|
dcheng
2015/12/01 19:47:53
Do you mind adding a comment that describes the lo
Charlie Reis
2015/12/01 22:11:51
Done. I also noticed that I should have been usin
| |
| 587 && m_webFrame->parent()->isWebLocalFrame() | |
| 588 && isBackForwardLoadType(toWebLocalFrameImpl(m_webFrame->parent())->fram e()->loader().loadType()) | |
| 589 && !m_webFrame->frame()->document()->loadEventFinished(); | |
| 590 | |
| 586 WrappedResourceRequest wrappedResourceRequest(request); | 591 WrappedResourceRequest wrappedResourceRequest(request); |
| 587 WebFrameClient::NavigationPolicyInfo navigationInfo(wrappedResourceRequest); | 592 WebFrameClient::NavigationPolicyInfo navigationInfo(wrappedResourceRequest); |
| 588 navigationInfo.navigationType = static_cast<WebNavigationType>(type); | 593 navigationInfo.navigationType = static_cast<WebNavigationType>(type); |
| 589 navigationInfo.defaultPolicy = static_cast<WebNavigationPolicy>(policy); | 594 navigationInfo.defaultPolicy = static_cast<WebNavigationPolicy>(policy); |
| 590 navigationInfo.extraData = ds ? ds->extraData() : nullptr; | 595 navigationInfo.extraData = ds ? ds->extraData() : nullptr; |
| 591 navigationInfo.replacesCurrentHistoryItem = replacesCurrentHistoryItem; | 596 navigationInfo.replacesCurrentHistoryItem = replacesCurrentHistoryItem; |
| 597 navigationInfo.isHistoryNavigationInNewChildFrame = isHistoryNavigationInNew ChildFrame; | |
| 592 | 598 |
| 593 WebNavigationPolicy webPolicy = m_webFrame->client()->decidePolicyForNavigat ion(navigationInfo); | 599 WebNavigationPolicy webPolicy = m_webFrame->client()->decidePolicyForNavigat ion(navigationInfo); |
| 594 return static_cast<NavigationPolicy>(webPolicy); | 600 return static_cast<NavigationPolicy>(webPolicy); |
| 595 } | 601 } |
| 596 | 602 |
| 597 bool FrameLoaderClientImpl::hasPendingNavigation() | 603 bool FrameLoaderClientImpl::hasPendingNavigation() |
| 598 { | 604 { |
| 599 if (!m_webFrame->client()) | 605 if (!m_webFrame->client()) |
| 600 return false; | 606 return false; |
| 601 | 607 |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1012 | 1018 |
| 1013 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde nTerminationDisablerType type) | 1019 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde nTerminationDisablerType type) |
| 1014 { | 1020 { |
| 1015 if (m_webFrame->client()) { | 1021 if (m_webFrame->client()) { |
| 1016 m_webFrame->client()->suddenTerminationDisablerChanged( | 1022 m_webFrame->client()->suddenTerminationDisablerChanged( |
| 1017 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type)); | 1023 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type)); |
| 1018 } | 1024 } |
| 1019 } | 1025 } |
| 1020 | 1026 |
| 1021 } // namespace blink | 1027 } // namespace blink |
| OLD | NEW |