| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "web/WebPagePopupImpl.h" | 31 #include "web/WebPagePopupImpl.h" |
| 32 | 32 |
| 33 #include "core/dom/ContextFeatures.h" | 33 #include "core/dom/ContextFeatures.h" |
| 34 #include "core/events/MessageEvent.h" | 34 #include "core/events/MessageEvent.h" |
| 35 #include "core/frame/FrameHost.h" | 35 #include "core/frame/FrameHost.h" |
| 36 #include "core/frame/FrameView.h" | 36 #include "core/frame/FrameView.h" |
| 37 #include "core/frame/LocalFrame.h" | 37 #include "core/frame/LocalFrame.h" |
| 38 #include "core/frame/LocalFrameClient.h" |
| 38 #include "core/frame/Settings.h" | 39 #include "core/frame/Settings.h" |
| 39 #include "core/frame/VisualViewport.h" | 40 #include "core/frame/VisualViewport.h" |
| 40 #include "core/input/EventHandler.h" | 41 #include "core/input/EventHandler.h" |
| 41 #include "core/layout/api/LayoutAPIShim.h" | 42 #include "core/layout/api/LayoutAPIShim.h" |
| 42 #include "core/layout/api/LayoutViewItem.h" | 43 #include "core/layout/api/LayoutViewItem.h" |
| 43 #include "core/loader/EmptyClients.h" | 44 #include "core/loader/EmptyClients.h" |
| 44 #include "core/loader/FrameLoadRequest.h" | 45 #include "core/loader/FrameLoadRequest.h" |
| 45 #include "core/page/FocusController.h" | 46 #include "core/page/FocusController.h" |
| 46 #include "core/page/Page.h" | 47 #include "core/page/Page.h" |
| 47 #include "core/page/PagePopupClient.h" | 48 #include "core/page/PagePopupClient.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 m_page->settings().setMinimumFontSize(mainSettings.getMinimumFontSize()); | 299 m_page->settings().setMinimumFontSize(mainSettings.getMinimumFontSize()); |
| 299 m_page->settings().setMinimumLogicalFontSize( | 300 m_page->settings().setMinimumLogicalFontSize( |
| 300 mainSettings.getMinimumLogicalFontSize()); | 301 mainSettings.getMinimumLogicalFontSize()); |
| 301 // FIXME: Should we support enabling a11y while a popup is shown? | 302 // FIXME: Should we support enabling a11y while a popup is shown? |
| 302 m_page->settings().setAccessibilityEnabled( | 303 m_page->settings().setAccessibilityEnabled( |
| 303 mainSettings.getAccessibilityEnabled()); | 304 mainSettings.getAccessibilityEnabled()); |
| 304 m_page->settings().setScrollAnimatorEnabled( | 305 m_page->settings().setScrollAnimatorEnabled( |
| 305 mainSettings.getScrollAnimatorEnabled()); | 306 mainSettings.getScrollAnimatorEnabled()); |
| 306 | 307 |
| 307 provideContextFeaturesTo(*m_page, WTF::makeUnique<PagePopupFeaturesClient>()); | 308 provideContextFeaturesTo(*m_page, WTF::makeUnique<PagePopupFeaturesClient>()); |
| 308 DEFINE_STATIC_LOCAL(FrameLoaderClient, emptyFrameLoaderClient, | 309 DEFINE_STATIC_LOCAL(LocalFrameClient, emptyLocalFrameClient, |
| 309 (EmptyFrameLoaderClient::create())); | 310 (EmptyLocalFrameClient::create())); |
| 310 LocalFrame* frame = | 311 LocalFrame* frame = |
| 311 LocalFrame::create(&emptyFrameLoaderClient, &m_page->frameHost(), 0); | 312 LocalFrame::create(&emptyLocalFrameClient, &m_page->frameHost(), 0); |
| 312 frame->setPagePopupOwner(m_popupClient->ownerElement()); | 313 frame->setPagePopupOwner(m_popupClient->ownerElement()); |
| 313 frame->setView(FrameView::create(*frame)); | 314 frame->setView(FrameView::create(*frame)); |
| 314 frame->init(); | 315 frame->init(); |
| 315 frame->view()->setParentVisible(true); | 316 frame->view()->setParentVisible(true); |
| 316 frame->view()->setSelfVisible(true); | 317 frame->view()->setSelfVisible(true); |
| 317 frame->view()->setTransparent(false); | 318 frame->view()->setTransparent(false); |
| 318 if (AXObjectCache* cache = | 319 if (AXObjectCache* cache = |
| 319 m_popupClient->ownerElement().document().existingAXObjectCache()) | 320 m_popupClient->ownerElement().document().existingAXObjectCache()) |
| 320 cache->childrenChanged(&m_popupClient->ownerElement()); | 321 cache->childrenChanged(&m_popupClient->ownerElement()); |
| 321 | 322 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 // A WebPagePopupImpl instance usually has two references. | 601 // A WebPagePopupImpl instance usually has two references. |
| 601 // - One owned by the instance itself. It represents the visible widget. | 602 // - One owned by the instance itself. It represents the visible widget. |
| 602 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 603 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
| 603 // WebPagePopupImpl to close. | 604 // WebPagePopupImpl to close. |
| 604 // We need them because the closing operation is asynchronous and the widget | 605 // We need them because the closing operation is asynchronous and the widget |
| 605 // can be closed while the WebViewImpl is unaware of it. | 606 // can be closed while the WebViewImpl is unaware of it. |
| 606 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 607 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 607 } | 608 } |
| 608 | 609 |
| 609 } // namespace blink | 610 } // namespace blink |
| OLD | NEW |