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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 192 |
193 m_page = adoptPtr(new Page(pageClients)); | 193 m_page = adoptPtr(new Page(pageClients)); |
194 m_page->settings().setScriptEnabled(true); | 194 m_page->settings().setScriptEnabled(true); |
195 m_page->settings().setAllowScriptsToCloseWindows(true); | 195 m_page->settings().setAllowScriptsToCloseWindows(true); |
196 m_page->setDeviceScaleFactor(m_webView->deviceScaleFactor()); | 196 m_page->setDeviceScaleFactor(m_webView->deviceScaleFactor()); |
197 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi
ceSupportsTouch()); | 197 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi
ceSupportsTouch()); |
198 | 198 |
199 static ContextFeaturesClient* pagePopupFeaturesClient = new PagePopupFeatur
esClient(); | 199 static ContextFeaturesClient* pagePopupFeaturesClient = new PagePopupFeatur
esClient(); |
200 provideContextFeaturesTo(m_page.get(), pagePopupFeaturesClient); | 200 provideContextFeaturesTo(m_page.get(), pagePopupFeaturesClient); |
201 static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClie
nt(); | 201 static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClie
nt(); |
202 RefPtr<Frame> frame = Frame::create(FrameInit::create(0, m_page.get(), empty
FrameLoaderClient)); | 202 RefPtr<Frame> frame = Frame::create(FrameInit::create(0, &m_page->frameHost(
), emptyFrameLoaderClient)); |
203 frame->setView(FrameView::create(frame.get())); | 203 frame->setView(FrameView::create(frame.get())); |
204 frame->init(); | 204 frame->init(); |
205 frame->view()->resize(m_popupClient->contentSize()); | 205 frame->view()->resize(m_popupClient->contentSize()); |
206 frame->view()->setTransparent(false); | 206 frame->view()->setTransparent(false); |
207 | 207 |
208 DOMWindowPagePopup::install(frame->domWindow(), m_popupClient); | 208 DOMWindowPagePopup::install(frame->domWindow(), m_popupClient); |
209 | 209 |
210 DocumentWriter* writer = frame->loader().activeDocumentLoader()->beginWritin
g("text/html", "UTF-8"); | 210 DocumentWriter* writer = frame->loader().activeDocumentLoader()->beginWritin
g("text/html", "UTF-8"); |
211 m_popupClient->writeDocument(*writer); | 211 m_popupClient->writeDocument(*writer); |
212 frame->loader().activeDocumentLoader()->endWriting(writer); | 212 frame->loader().activeDocumentLoader()->endWriting(writer); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 // A WebPagePopupImpl instance usually has two references. | 337 // A WebPagePopupImpl instance usually has two references. |
338 // - One owned by the instance itself. It represents the visible widget. | 338 // - One owned by the instance itself. It represents the visible widget. |
339 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 339 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
340 // WebPagePopupImpl to close. | 340 // WebPagePopupImpl to close. |
341 // We need them because the closing operation is asynchronous and the widget | 341 // We need them because the closing operation is asynchronous and the widget |
342 // can be closed while the WebViewImpl is unaware of it. | 342 // can be closed while the WebViewImpl is unaware of it. |
343 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 343 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
344 } | 344 } |
345 | 345 |
346 } // namespace blink | 346 } // namespace blink |
OLD | NEW |