| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "WebPagePopupImpl.h" | 32 #include "WebPagePopupImpl.h" |
| 33 | 33 |
| 34 #include "WebInputEventConversion.h" | 34 #include "WebInputEventConversion.h" |
| 35 #include "WebSettingsImpl.h" | 35 #include "WebSettingsImpl.h" |
| 36 #include "WebViewClient.h" | 36 #include "WebViewClient.h" |
| 37 #include "WebViewImpl.h" | 37 #include "WebViewImpl.h" |
| 38 #include "WebWidgetClient.h" | 38 #include "WebWidgetClient.h" |
| 39 #include "core/dom/ContextFeatures.h" | 39 #include "core/dom/ContextFeatures.h" |
| 40 #include "core/loader/DocumentLoader.h" | |
| 41 #include "core/loader/EmptyClients.h" | 40 #include "core/loader/EmptyClients.h" |
| 41 #include "core/loader/FrameLoadRequest.h" |
| 42 #include "core/page/Chrome.h" | 42 #include "core/page/Chrome.h" |
| 43 #include "core/page/DOMWindowPagePopup.h" | 43 #include "core/page/DOMWindowPagePopup.h" |
| 44 #include "core/page/EventHandler.h" | 44 #include "core/page/EventHandler.h" |
| 45 #include "core/page/FocusController.h" | 45 #include "core/page/FocusController.h" |
| 46 #include "core/frame/Frame.h" | 46 #include "core/frame/Frame.h" |
| 47 #include "core/frame/FrameView.h" | 47 #include "core/frame/FrameView.h" |
| 48 #include "core/page/Page.h" | 48 #include "core/page/Page.h" |
| 49 #include "core/page/PagePopupClient.h" | 49 #include "core/page/PagePopupClient.h" |
| 50 #include "core/frame/Settings.h" | 50 #include "core/frame/Settings.h" |
| 51 #include "public/platform/WebCursorInfo.h" | 51 #include "public/platform/WebCursorInfo.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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->frameHost(
), emptyFrameLoaderClient)); | 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().documentLoader()->beginWriting("tex
t/html", "UTF-8"); | 210 RefPtr<SharedBuffer> data = SharedBuffer::create(); |
| 211 m_popupClient->writeDocument(*writer); | 211 m_popupClient->writeDocument(data.get()); |
| 212 frame->loader().documentLoader()->endWriting(writer); | 212 frame->loader().load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "t
ext/html", "UTF-8", KURL(), ForceSynchronousLoad))); |
| 213 return true; | 213 return true; |
| 214 } | 214 } |
| 215 | 215 |
| 216 void WebPagePopupImpl::destroyPage() | 216 void WebPagePopupImpl::destroyPage() |
| 217 { | 217 { |
| 218 if (!m_page) | 218 if (!m_page) |
| 219 return; | 219 return; |
| 220 | 220 |
| 221 if (m_page->mainFrame()) | 221 if (m_page->mainFrame()) |
| 222 m_page->mainFrame()->loader().frameDetached(); | 222 m_page->mainFrame()->loader().frameDetached(); |
| (...skipping 114 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 |