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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 m_chromeClient = adoptPtr(new PagePopupChromeClient(this)); | 236 m_chromeClient = adoptPtr(new PagePopupChromeClient(this)); |
237 pageClients.chromeClient = m_chromeClient.get(); | 237 pageClients.chromeClient = m_chromeClient.get(); |
238 | 238 |
239 m_page = adoptPtrWillBeNoop(new Page(pageClients)); | 239 m_page = adoptPtrWillBeNoop(new Page(pageClients)); |
240 m_page->settings().setScriptEnabled(true); | 240 m_page->settings().setScriptEnabled(true); |
241 m_page->settings().setAllowScriptsToCloseWindows(true); | 241 m_page->settings().setAllowScriptsToCloseWindows(true); |
242 m_page->setDeviceScaleFactor(m_webView->deviceScaleFactor()); | 242 m_page->setDeviceScaleFactor(m_webView->deviceScaleFactor()); |
243 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi
ceSupportsTouch()); | 243 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi
ceSupportsTouch()); |
244 // FIXME: Should we support enabling a11y while a popup is shown? | 244 // FIXME: Should we support enabling a11y while a popup is shown? |
245 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc
essibilityEnabled()); | 245 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc
essibilityEnabled()); |
246 m_page->settings().setScrollAnimatorEnabled(m_webView->page()->settings().sc
rollAnimatorEnabled()); | |
247 | 246 |
248 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient())); | 247 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient())); |
249 static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClien
t(); | 248 static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClien
t(); |
250 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderCl
ient, &m_page->frameHost(), 0); | 249 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderCl
ient, &m_page->frameHost(), 0); |
251 frame->setPagePopupOwner(m_popupClient->ownerElement()); | 250 frame->setPagePopupOwner(m_popupClient->ownerElement()); |
252 frame->setView(FrameView::create(frame.get())); | 251 frame->setView(FrameView::create(frame.get())); |
253 frame->init(); | 252 frame->init(); |
254 frame->view()->resize(m_popupClient->contentSize()); | 253 frame->view()->resize(m_popupClient->contentSize()); |
255 frame->view()->setTransparent(false); | 254 frame->view()->setTransparent(false); |
256 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing
AXObjectCache()) | 255 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing
AXObjectCache()) |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 // A WebPagePopupImpl instance usually has two references. | 484 // A WebPagePopupImpl instance usually has two references. |
486 // - One owned by the instance itself. It represents the visible widget. | 485 // - One owned by the instance itself. It represents the visible widget. |
487 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 486 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
488 // WebPagePopupImpl to close. | 487 // WebPagePopupImpl to close. |
489 // We need them because the closing operation is asynchronous and the widget | 488 // We need them because the closing operation is asynchronous and the widget |
490 // can be closed while the WebViewImpl is unaware of it. | 489 // can be closed while the WebViewImpl is unaware of it. |
491 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 490 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
492 } | 491 } |
493 | 492 |
494 } // namespace blink | 493 } // namespace blink |
OLD | NEW |