| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 return true; | 269 return true; |
| 270 } | 270 } |
| 271 | 271 |
| 272 bool WebPagePopupImpl::initializePage() | 272 bool WebPagePopupImpl::initializePage() |
| 273 { | 273 { |
| 274 Page::PageClients pageClients; | 274 Page::PageClients pageClients; |
| 275 fillWithEmptyClients(pageClients); | 275 fillWithEmptyClients(pageClients); |
| 276 m_chromeClient = PagePopupChromeClient::create(this); | 276 m_chromeClient = PagePopupChromeClient::create(this); |
| 277 pageClients.chromeClient = m_chromeClient.get(); | 277 pageClients.chromeClient = m_chromeClient.get(); |
| 278 | 278 |
| 279 Settings& mainSettings = m_webView->page()->settings(); |
| 279 m_page = Page::create(pageClients); | 280 m_page = Page::create(pageClients); |
| 280 m_page->settings().setScriptEnabled(true); | 281 m_page->settings().setScriptEnabled(true); |
| 281 m_page->settings().setAllowScriptsToCloseWindows(true); | 282 m_page->settings().setAllowScriptsToCloseWindows(true); |
| 282 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi
ceSupportsTouch()); | 283 m_page->settings().setDeviceSupportsTouch(mainSettings.deviceSupportsTouch()
); |
| 284 m_page->settings().setMinimumFontSize(mainSettings.minimumFontSize()); |
| 285 m_page->settings().setMinimumLogicalFontSize(mainSettings.minimumLogicalFont
Size()); |
| 283 // FIXME: Should we support enabling a11y while a popup is shown? | 286 // FIXME: Should we support enabling a11y while a popup is shown? |
| 284 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc
essibilityEnabled()); | 287 m_page->settings().setAccessibilityEnabled(mainSettings.accessibilityEnabled
()); |
| 285 m_page->settings().setScrollAnimatorEnabled(m_webView->page()->settings().sc
rollAnimatorEnabled()); | 288 m_page->settings().setScrollAnimatorEnabled(mainSettings.scrollAnimatorEnabl
ed()); |
| 286 | 289 |
| 287 provideContextFeaturesTo(*m_page, wrapUnique(new PagePopupFeaturesClient()))
; | 290 provideContextFeaturesTo(*m_page, wrapUnique(new PagePopupFeaturesClient()))
; |
| 288 DEFINE_STATIC_LOCAL(FrameLoaderClient, emptyFrameLoaderClient, (EmptyFrameLo
aderClient::create())); | 291 DEFINE_STATIC_LOCAL(FrameLoaderClient, emptyFrameLoaderClient, (EmptyFrameLo
aderClient::create())); |
| 289 LocalFrame* frame = LocalFrame::create(&emptyFrameLoaderClient, &m_page->fra
meHost(), 0); | 292 LocalFrame* frame = LocalFrame::create(&emptyFrameLoaderClient, &m_page->fra
meHost(), 0); |
| 290 frame->setPagePopupOwner(m_popupClient->ownerElement()); | 293 frame->setPagePopupOwner(m_popupClient->ownerElement()); |
| 291 frame->setView(FrameView::create(frame)); | 294 frame->setView(FrameView::create(frame)); |
| 292 frame->init(); | 295 frame->init(); |
| 293 frame->view()->setParentVisible(true); | 296 frame->view()->setParentVisible(true); |
| 294 frame->view()->setSelfVisible(true); | 297 frame->view()->setSelfVisible(true); |
| 295 frame->view()->setTransparent(false); | 298 frame->view()->setTransparent(false); |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 // A WebPagePopupImpl instance usually has two references. | 579 // A WebPagePopupImpl instance usually has two references. |
| 577 // - One owned by the instance itself. It represents the visible widget. | 580 // - One owned by the instance itself. It represents the visible widget. |
| 578 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 581 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
| 579 // WebPagePopupImpl to close. | 582 // WebPagePopupImpl to close. |
| 580 // We need them because the closing operation is asynchronous and the widget | 583 // We need them because the closing operation is asynchronous and the widget |
| 581 // can be closed while the WebViewImpl is unaware of it. | 584 // can be closed while the WebViewImpl is unaware of it. |
| 582 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 585 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 583 } | 586 } |
| 584 | 587 |
| 585 } // namespace blink | 588 } // namespace blink |
| OLD | NEW |