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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 fillWithEmptyClients(pageClients); | 203 fillWithEmptyClients(pageClients); |
204 m_chromeClient = adoptPtr(new PagePopupChromeClient(this)); | 204 m_chromeClient = adoptPtr(new PagePopupChromeClient(this)); |
205 pageClients.chromeClient = m_chromeClient.get(); | 205 pageClients.chromeClient = m_chromeClient.get(); |
206 | 206 |
207 m_page = adoptPtr(new Page(pageClients)); | 207 m_page = adoptPtr(new Page(pageClients)); |
208 m_page->settings().setScriptEnabled(true); | 208 m_page->settings().setScriptEnabled(true); |
209 m_page->settings().setAllowScriptsToCloseWindows(true); | 209 m_page->settings().setAllowScriptsToCloseWindows(true); |
210 m_page->setDeviceScaleFactor(m_webView->deviceScaleFactor()); | 210 m_page->setDeviceScaleFactor(m_webView->deviceScaleFactor()); |
211 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi
ceSupportsTouch()); | 211 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi
ceSupportsTouch()); |
212 | 212 |
213 static ContextFeaturesClient* pagePopupFeaturesClient = new PagePopupFeatur
esClient(); | 213 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient())); |
214 provideContextFeaturesTo(*m_page, pagePopupFeaturesClient); | |
215 static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClie
nt(); | 214 static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClie
nt(); |
216 RefPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderClient, &m_pag
e->frameHost(), 0); | 215 RefPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderClient, &m_pag
e->frameHost(), 0); |
217 frame->setView(FrameView::create(frame.get())); | 216 frame->setView(FrameView::create(frame.get())); |
218 frame->init(); | 217 frame->init(); |
219 frame->view()->resize(m_popupClient->contentSize()); | 218 frame->view()->resize(m_popupClient->contentSize()); |
220 frame->view()->setTransparent(false); | 219 frame->view()->setTransparent(false); |
221 | 220 |
222 ASSERT(frame->domWindow()); | 221 ASSERT(frame->domWindow()); |
223 DOMWindowPagePopup::install(*frame->domWindow(), m_popupClient); | 222 DOMWindowPagePopup::install(*frame->domWindow(), m_popupClient); |
224 | 223 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 // A WebPagePopupImpl instance usually has two references. | 425 // A WebPagePopupImpl instance usually has two references. |
427 // - One owned by the instance itself. It represents the visible widget. | 426 // - One owned by the instance itself. It represents the visible widget. |
428 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 427 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
429 // WebPagePopupImpl to close. | 428 // WebPagePopupImpl to close. |
430 // We need them because the closing operation is asynchronous and the widget | 429 // We need them because the closing operation is asynchronous and the widget |
431 // can be closed while the WebViewImpl is unaware of it. | 430 // can be closed while the WebViewImpl is unaware of it. |
432 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 431 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
433 } | 432 } |
434 | 433 |
435 } // namespace blink | 434 } // namespace blink |
OLD | NEW |