| 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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 Frame* FrameLoaderClientImpl::dispatchCreatePage(const NavigationAction& action) | 752 Frame* FrameLoaderClientImpl::dispatchCreatePage(const NavigationAction& action) |
| 753 { | 753 { |
| 754 // Make sure that we have a valid disposition. This should have been set in | 754 // Make sure that we have a valid disposition. This should have been set in |
| 755 // the preceeding call to dispatchDecidePolicyForNewWindowAction. | 755 // the preceeding call to dispatchDecidePolicyForNewWindowAction. |
| 756 ASSERT(m_nextNavigationPolicy != WebNavigationPolicyIgnore); | 756 ASSERT(m_nextNavigationPolicy != WebNavigationPolicyIgnore); |
| 757 WebNavigationPolicy policy = m_nextNavigationPolicy; | 757 WebNavigationPolicy policy = m_nextNavigationPolicy; |
| 758 m_nextNavigationPolicy = WebNavigationPolicyIgnore; | 758 m_nextNavigationPolicy = WebNavigationPolicyIgnore; |
| 759 | 759 |
| 760 // Store the disposition on the opener ChromeClientImpl so that we can pass | 760 // Store the disposition on the opener ChromeClientImpl so that we can pass |
| 761 // it to WebViewClient::createView. | 761 // it to WebViewClient::createView. |
| 762 ChromeClientImpl* chromeClient = static_cast<ChromeClientImpl*>(m_webFrame->
frame()->page()->chrome()->client()); | 762 ChromeClientImpl* chromeClient = static_cast<ChromeClientImpl*>(m_webFrame->
frame()->page()->chrome().client()); |
| 763 chromeClient->setNewWindowNavigationPolicy(policy); | 763 chromeClient->setNewWindowNavigationPolicy(policy); |
| 764 | 764 |
| 765 if (m_webFrame->frame()->settings() && !m_webFrame->frame()->settings()->sup
portsMultipleWindows()) | 765 if (m_webFrame->frame()->settings() && !m_webFrame->frame()->settings()->sup
portsMultipleWindows()) |
| 766 return m_webFrame->frame(); | 766 return m_webFrame->frame(); |
| 767 | 767 |
| 768 struct WindowFeatures features; | 768 struct WindowFeatures features; |
| 769 Page* newPage = m_webFrame->frame()->page()->chrome()->createWindow( | 769 Page* newPage = m_webFrame->frame()->page()->chrome().createWindow( |
| 770 m_webFrame->frame(), FrameLoadRequest(m_webFrame->frame()->document()->s
ecurityOrigin()), | 770 m_webFrame->frame(), FrameLoadRequest(m_webFrame->frame()->document()->s
ecurityOrigin()), |
| 771 features, action); | 771 features, action); |
| 772 | 772 |
| 773 // createWindow can return null (e.g., popup blocker denies the window). | 773 // createWindow can return null (e.g., popup blocker denies the window). |
| 774 if (!newPage) | 774 if (!newPage) |
| 775 return 0; | 775 return 0; |
| 776 | 776 |
| 777 // Also give the disposition to the new window. | 777 // Also give the disposition to the new window. |
| 778 WebViewImpl::fromPage(newPage)->setInitialNavigationPolicy(policy); | 778 WebViewImpl::fromPage(newPage)->setInitialNavigationPolicy(policy); |
| 779 return newPage->mainFrame(); | 779 return newPage->mainFrame(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 798 return PolicyDownload; | 798 return PolicyDownload; |
| 799 | 799 |
| 800 // Remember the disposition for when dispatchCreatePage is called. It is | 800 // Remember the disposition for when dispatchCreatePage is called. It is |
| 801 // unfortunate that WebCore does not provide us with any context when | 801 // unfortunate that WebCore does not provide us with any context when |
| 802 // creating or showing the new window that would allow us to avoid having | 802 // creating or showing the new window that would allow us to avoid having |
| 803 // to keep this state. | 803 // to keep this state. |
| 804 m_nextNavigationPolicy = navigationPolicy; | 804 m_nextNavigationPolicy = navigationPolicy; |
| 805 | 805 |
| 806 // Store the disposition on the opener ChromeClientImpl so that we can pass | 806 // Store the disposition on the opener ChromeClientImpl so that we can pass |
| 807 // it to WebViewClient::createView. | 807 // it to WebViewClient::createView. |
| 808 ChromeClientImpl* chromeClient = static_cast<ChromeClientImpl*>(m_webFrame->
frame()->page()->chrome()->client()); | 808 ChromeClientImpl* chromeClient = static_cast<ChromeClientImpl*>(m_webFrame->
frame()->page()->chrome().client()); |
| 809 chromeClient->setNewWindowNavigationPolicy(navigationPolicy); | 809 chromeClient->setNewWindowNavigationPolicy(navigationPolicy); |
| 810 | 810 |
| 811 return PolicyUse; | 811 return PolicyUse; |
| 812 } | 812 } |
| 813 | 813 |
| 814 PolicyAction FrameLoaderClientImpl::decidePolicyForNavigationAction( | 814 PolicyAction FrameLoaderClientImpl::decidePolicyForNavigationAction( |
| 815 const NavigationAction& action, | 815 const NavigationAction& action, |
| 816 const ResourceRequest& request) { | 816 const ResourceRequest& request) { |
| 817 | 817 |
| 818 // It is valid for this function to be invoked in code paths where the | 818 // It is valid for this function to be invoked in code paths where the |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 m_webFrame->client()->didLoseWebGLContext(m_webFrame, arbRobustnessConte
xtLostReason); | 1360 m_webFrame->client()->didLoseWebGLContext(m_webFrame, arbRobustnessConte
xtLostReason); |
| 1361 } | 1361 } |
| 1362 | 1362 |
| 1363 void FrameLoaderClientImpl::dispatchWillInsertBody() | 1363 void FrameLoaderClientImpl::dispatchWillInsertBody() |
| 1364 { | 1364 { |
| 1365 if (m_webFrame->client()) | 1365 if (m_webFrame->client()) |
| 1366 m_webFrame->client()->willInsertBody(m_webFrame); | 1366 m_webFrame->client()->willInsertBody(m_webFrame); |
| 1367 } | 1367 } |
| 1368 | 1368 |
| 1369 } // namespace WebKit | 1369 } // namespace WebKit |
| OLD | NEW |