| 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 return userPolicy == NavigationPolicyNewBackgroundTab; | 527 return userPolicy == NavigationPolicyNewBackgroundTab; |
| 528 } | 528 } |
| 529 | 529 |
| 530 NavigationPolicy LocalFrameClientImpl::decidePolicyForNavigation( | 530 NavigationPolicy LocalFrameClientImpl::decidePolicyForNavigation( |
| 531 const ResourceRequest& request, | 531 const ResourceRequest& request, |
| 532 DocumentLoader* loader, | 532 DocumentLoader* loader, |
| 533 NavigationType type, | 533 NavigationType type, |
| 534 NavigationPolicy policy, | 534 NavigationPolicy policy, |
| 535 bool replacesCurrentHistoryItem, | 535 bool replacesCurrentHistoryItem, |
| 536 bool isClientRedirect, | 536 bool isClientRedirect, |
| 537 HTMLFormElement* form, | 537 HTMLFormElement* form) { |
| 538 ContentSecurityPolicyDisposition | |
| 539 shouldCheckMainWorldContentSecurityPolicy) { | |
| 540 if (!m_webFrame->client()) | 538 if (!m_webFrame->client()) |
| 541 return NavigationPolicyIgnore; | 539 return NavigationPolicyIgnore; |
| 542 | 540 |
| 543 if (policy == NavigationPolicyNewBackgroundTab && | 541 if (policy == NavigationPolicyNewBackgroundTab && |
| 544 !allowCreatingBackgroundTabs() && | 542 !allowCreatingBackgroundTabs() && |
| 545 !UIEventWithKeyState::newTabModifierSetFromIsolatedWorld()) | 543 !UIEventWithKeyState::newTabModifierSetFromIsolatedWorld()) |
| 546 policy = NavigationPolicyNewForegroundTab; | 544 policy = NavigationPolicyNewForegroundTab; |
| 547 | 545 |
| 548 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader(loader); | 546 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader(loader); |
| 549 | 547 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 566 | 564 |
| 567 WrappedResourceRequest wrappedResourceRequest(request); | 565 WrappedResourceRequest wrappedResourceRequest(request); |
| 568 WebFrameClient::NavigationPolicyInfo navigationInfo(wrappedResourceRequest); | 566 WebFrameClient::NavigationPolicyInfo navigationInfo(wrappedResourceRequest); |
| 569 navigationInfo.navigationType = static_cast<WebNavigationType>(type); | 567 navigationInfo.navigationType = static_cast<WebNavigationType>(type); |
| 570 navigationInfo.defaultPolicy = static_cast<WebNavigationPolicy>(policy); | 568 navigationInfo.defaultPolicy = static_cast<WebNavigationPolicy>(policy); |
| 571 navigationInfo.extraData = ds ? ds->getExtraData() : nullptr; | 569 navigationInfo.extraData = ds ? ds->getExtraData() : nullptr; |
| 572 navigationInfo.replacesCurrentHistoryItem = replacesCurrentHistoryItem; | 570 navigationInfo.replacesCurrentHistoryItem = replacesCurrentHistoryItem; |
| 573 navigationInfo.isHistoryNavigationInNewChildFrame = | 571 navigationInfo.isHistoryNavigationInNewChildFrame = |
| 574 isHistoryNavigationInNewChildFrame; | 572 isHistoryNavigationInNewChildFrame; |
| 575 navigationInfo.isClientRedirect = isClientRedirect; | 573 navigationInfo.isClientRedirect = isClientRedirect; |
| 576 navigationInfo.shouldCheckMainWorldContentSecurityPolicy = | |
| 577 shouldCheckMainWorldContentSecurityPolicy == CheckContentSecurityPolicy | |
| 578 ? WebContentSecurityPolicyDispositionCheck | |
| 579 : WebContentSecurityPolicyDispositionDoNotCheck; | |
| 580 // Caching could be disabled for requests initiated by DevTools. | 574 // Caching could be disabled for requests initiated by DevTools. |
| 581 // TODO(ananta) | 575 // TODO(ananta) |
| 582 // We should extract the network cache state into a global component which | 576 // We should extract the network cache state into a global component which |
| 583 // can be queried here and wherever necessary. | 577 // can be queried here and wherever necessary. |
| 584 navigationInfo.isCacheDisabled = | 578 navigationInfo.isCacheDisabled = |
| 585 devToolsAgent() ? devToolsAgent()->cacheDisabled() : false; | 579 devToolsAgent() ? devToolsAgent()->cacheDisabled() : false; |
| 586 if (form) | 580 if (form) |
| 587 navigationInfo.form = WebFormElement(form); | 581 navigationInfo.form = WebFormElement(form); |
| 588 | 582 |
| 589 std::unique_ptr<SourceLocation> sourceLocation = | 583 std::unique_ptr<SourceLocation> sourceLocation = |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 KURL LocalFrameClientImpl::overrideFlashEmbedWithHTML(const KURL& url) { | 1024 KURL LocalFrameClientImpl::overrideFlashEmbedWithHTML(const KURL& url) { |
| 1031 return m_webFrame->client()->overrideFlashEmbedWithHTML(WebURL(url)); | 1025 return m_webFrame->client()->overrideFlashEmbedWithHTML(WebURL(url)); |
| 1032 } | 1026 } |
| 1033 | 1027 |
| 1034 void LocalFrameClientImpl::setHasReceivedUserGesture() { | 1028 void LocalFrameClientImpl::setHasReceivedUserGesture() { |
| 1035 if (m_webFrame->client()) | 1029 if (m_webFrame->client()) |
| 1036 m_webFrame->client()->setHasReceivedUserGesture(); | 1030 m_webFrame->client()->setHasReceivedUserGesture(); |
| 1037 } | 1031 } |
| 1038 | 1032 |
| 1039 } // namespace blink | 1033 } // namespace blink |
| OLD | NEW |