| 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 // Newly created child frames may need to be navigated to a history item |
| 587 // during a back/forward navigation. This will only happen when the parent |
| 588 // is a LocalFrame doing a back/forward navigation that has not completed. |
| 589 // (If the load has completed and the parent later adds a frame with script, |
| 590 // we do not want to use a history item for it.) |
| 591 bool isHistoryNavigationInNewChildFrame = m_webFrame->parent() |
| 592 && m_webFrame->parent()->isWebLocalFrame() |
| 593 && isBackForwardLoadType(toWebLocalFrameImpl(m_webFrame->parent())->fram
e()->loader().loadType()) |
| 594 && !toWebLocalFrameImpl(m_webFrame->parent())->frame()->document()->load
EventFinished(); |
| 595 |
| 586 WrappedResourceRequest wrappedResourceRequest(request); | 596 WrappedResourceRequest wrappedResourceRequest(request); |
| 587 WebFrameClient::NavigationPolicyInfo navigationInfo(wrappedResourceRequest); | 597 WebFrameClient::NavigationPolicyInfo navigationInfo(wrappedResourceRequest); |
| 588 navigationInfo.navigationType = static_cast<WebNavigationType>(type); | 598 navigationInfo.navigationType = static_cast<WebNavigationType>(type); |
| 589 navigationInfo.defaultPolicy = static_cast<WebNavigationPolicy>(policy); | 599 navigationInfo.defaultPolicy = static_cast<WebNavigationPolicy>(policy); |
| 590 navigationInfo.extraData = ds ? ds->extraData() : nullptr; | 600 navigationInfo.extraData = ds ? ds->extraData() : nullptr; |
| 591 navigationInfo.replacesCurrentHistoryItem = replacesCurrentHistoryItem; | 601 navigationInfo.replacesCurrentHistoryItem = replacesCurrentHistoryItem; |
| 602 navigationInfo.isHistoryNavigationInNewChildFrame = isHistoryNavigationInNew
ChildFrame; |
| 592 | 603 |
| 593 WebNavigationPolicy webPolicy = m_webFrame->client()->decidePolicyForNavigat
ion(navigationInfo); | 604 WebNavigationPolicy webPolicy = m_webFrame->client()->decidePolicyForNavigat
ion(navigationInfo); |
| 594 return static_cast<NavigationPolicy>(webPolicy); | 605 return static_cast<NavigationPolicy>(webPolicy); |
| 595 } | 606 } |
| 596 | 607 |
| 597 bool FrameLoaderClientImpl::hasPendingNavigation() | 608 bool FrameLoaderClientImpl::hasPendingNavigation() |
| 598 { | 609 { |
| 599 if (!m_webFrame->client()) | 610 if (!m_webFrame->client()) |
| 600 return false; | 611 return false; |
| 601 | 612 |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 | 1023 |
| 1013 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde
nTerminationDisablerType type) | 1024 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde
nTerminationDisablerType type) |
| 1014 { | 1025 { |
| 1015 if (m_webFrame->client()) { | 1026 if (m_webFrame->client()) { |
| 1016 m_webFrame->client()->suddenTerminationDisablerChanged( | 1027 m_webFrame->client()->suddenTerminationDisablerChanged( |
| 1017 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>(
type)); | 1028 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>(
type)); |
| 1018 } | 1029 } |
| 1019 } | 1030 } |
| 1020 | 1031 |
| 1021 } // namespace blink | 1032 } // namespace blink |
| OLD | NEW |