| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 RefPtr<Frame> frame = Frame::create(m_page.get(), 0, emptyFrameLoaderClient)
; | 209 RefPtr<Frame> frame = Frame::create(m_page.get(), 0, emptyFrameLoaderClient)
; |
| 210 frame->setView(FrameView::create(frame.get())); | 210 frame->setView(FrameView::create(frame.get())); |
| 211 frame->init(); | 211 frame->init(); |
| 212 frame->view()->resize(m_popupClient->contentSize()); | 212 frame->view()->resize(m_popupClient->contentSize()); |
| 213 frame->view()->setTransparent(false); | 213 frame->view()->setTransparent(false); |
| 214 | 214 |
| 215 DOMWindowPagePopup::install(frame->document()->domWindow(), m_popupClient); | 215 DOMWindowPagePopup::install(frame->document()->domWindow(), m_popupClient); |
| 216 | 216 |
| 217 DocumentWriter* writer = frame->loader()->activeDocumentLoader()->beginWriti
ng("text/html", "UTF-8"); | 217 DocumentWriter* writer = frame->loader()->activeDocumentLoader()->beginWriti
ng("text/html", "UTF-8"); |
| 218 m_popupClient->writeDocument(*writer); | 218 m_popupClient->writeDocument(*writer); |
| 219 writer->end(); | 219 frame->loader()->activeDocumentLoader()->endWriting(writer); |
| 220 return true; | 220 return true; |
| 221 } | 221 } |
| 222 | 222 |
| 223 void WebPagePopupImpl::destroyPage() | 223 void WebPagePopupImpl::destroyPage() |
| 224 { | 224 { |
| 225 if (!m_page) | 225 if (!m_page) |
| 226 return; | 226 return; |
| 227 | 227 |
| 228 if (m_page->mainFrame()) | 228 if (m_page->mainFrame()) |
| 229 m_page->mainFrame()->loader()->frameDetached(); | 229 m_page->mainFrame()->loader()->frameDetached(); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 // A WebPagePopupImpl instance usually has two references. | 345 // A WebPagePopupImpl instance usually has two references. |
| 346 // - One owned by the instance itself. It represents the visible widget. | 346 // - One owned by the instance itself. It represents the visible widget. |
| 347 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 347 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
| 348 // WebPagePopupImpl to close. | 348 // WebPagePopupImpl to close. |
| 349 // We need them because the closing operation is asynchronous and the widget | 349 // We need them because the closing operation is asynchronous and the widget |
| 350 // can be closed while the WebViewImpl is unaware of it. | 350 // can be closed while the WebViewImpl is unaware of it. |
| 351 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 351 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 352 } | 352 } |
| 353 | 353 |
| 354 } // namespace WebKit | 354 } // namespace WebKit |
| OLD | NEW |