| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 bool WebPagePopupImpl::initializePage() { | 278 bool WebPagePopupImpl::initializePage() { |
| 279 Page::PageClients pageClients; | 279 Page::PageClients pageClients; |
| 280 fillWithEmptyClients(pageClients); | 280 fillWithEmptyClients(pageClients); |
| 281 m_chromeClient = PagePopupChromeClient::create(this); | 281 m_chromeClient = PagePopupChromeClient::create(this); |
| 282 pageClients.chromeClient = m_chromeClient.get(); | 282 pageClients.chromeClient = m_chromeClient.get(); |
| 283 | 283 |
| 284 Settings& mainSettings = m_webView->page()->settings(); | 284 Settings& mainSettings = m_webView->page()->settings(); |
| 285 m_page = Page::create(pageClients); | 285 m_page = Page::create(pageClients); |
| 286 m_page->settings().setScriptEnabled(true); | 286 m_page->settings().setScriptEnabled(true); |
| 287 m_page->settings().setAllowScriptsToCloseWindows(true); | 287 m_page->settings().setAllowScriptsToCloseWindows(true); |
| 288 m_page->settings().setDeviceSupportsTouch(mainSettings.deviceSupportsTouch()); | 288 m_page->settings().setDeviceSupportsTouch( |
| 289 m_page->settings().setMinimumFontSize(mainSettings.minimumFontSize()); | 289 mainSettings.getDeviceSupportsTouch()); |
| 290 m_page->settings().setMinimumFontSize(mainSettings.getMinimumFontSize()); |
| 290 m_page->settings().setMinimumLogicalFontSize( | 291 m_page->settings().setMinimumLogicalFontSize( |
| 291 mainSettings.minimumLogicalFontSize()); | 292 mainSettings.getMinimumLogicalFontSize()); |
| 292 // FIXME: Should we support enabling a11y while a popup is shown? | 293 // FIXME: Should we support enabling a11y while a popup is shown? |
| 293 m_page->settings().setAccessibilityEnabled( | 294 m_page->settings().setAccessibilityEnabled( |
| 294 mainSettings.accessibilityEnabled()); | 295 mainSettings.getAccessibilityEnabled()); |
| 295 m_page->settings().setScrollAnimatorEnabled( | 296 m_page->settings().setScrollAnimatorEnabled( |
| 296 mainSettings.scrollAnimatorEnabled()); | 297 mainSettings.getScrollAnimatorEnabled()); |
| 297 | 298 |
| 298 provideContextFeaturesTo(*m_page, WTF::makeUnique<PagePopupFeaturesClient>()); | 299 provideContextFeaturesTo(*m_page, WTF::makeUnique<PagePopupFeaturesClient>()); |
| 299 DEFINE_STATIC_LOCAL(FrameLoaderClient, emptyFrameLoaderClient, | 300 DEFINE_STATIC_LOCAL(FrameLoaderClient, emptyFrameLoaderClient, |
| 300 (EmptyFrameLoaderClient::create())); | 301 (EmptyFrameLoaderClient::create())); |
| 301 LocalFrame* frame = | 302 LocalFrame* frame = |
| 302 LocalFrame::create(&emptyFrameLoaderClient, &m_page->frameHost(), 0); | 303 LocalFrame::create(&emptyFrameLoaderClient, &m_page->frameHost(), 0); |
| 303 frame->setPagePopupOwner(m_popupClient->ownerElement()); | 304 frame->setPagePopupOwner(m_popupClient->ownerElement()); |
| 304 frame->setView(FrameView::create(*frame)); | 305 frame->setView(FrameView::create(*frame)); |
| 305 frame->init(); | 306 frame->init(); |
| 306 frame->view()->setParentVisible(true); | 307 frame->view()->setParentVisible(true); |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 // A WebPagePopupImpl instance usually has two references. | 593 // A WebPagePopupImpl instance usually has two references. |
| 593 // - One owned by the instance itself. It represents the visible widget. | 594 // - One owned by the instance itself. It represents the visible widget. |
| 594 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 595 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
| 595 // WebPagePopupImpl to close. | 596 // WebPagePopupImpl to close. |
| 596 // We need them because the closing operation is asynchronous and the widget | 597 // We need them because the closing operation is asynchronous and the widget |
| 597 // can be closed while the WebViewImpl is unaware of it. | 598 // can be closed while the WebViewImpl is unaware of it. |
| 598 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 599 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 599 } | 600 } |
| 600 | 601 |
| 601 } // namespace blink | 602 } // namespace blink |
| OLD | NEW |