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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClien
t(); | 242 static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClien
t(); |
243 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderCl
ient, &m_page->frameHost(), 0); | 243 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderCl
ient, &m_page->frameHost(), 0); |
244 frame->setPagePopupOwner(m_popupClient->ownerElement()); | 244 frame->setPagePopupOwner(m_popupClient->ownerElement()); |
245 frame->setView(FrameView::create(frame.get())); | 245 frame->setView(FrameView::create(frame.get())); |
246 frame->init(); | 246 frame->init(); |
247 frame->view()->resize(m_popupClient->contentSize()); | 247 frame->view()->resize(m_popupClient->contentSize()); |
248 frame->view()->setTransparent(false); | 248 frame->view()->setTransparent(false); |
249 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing
AXObjectCache()) | 249 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing
AXObjectCache()) |
250 cache->childrenChanged(&m_popupClient->ownerElement()); | 250 cache->childrenChanged(&m_popupClient->ownerElement()); |
251 | 251 |
252 ASSERT(frame->domWindow()); | 252 ASSERT(frame->localDOMWindow()); |
253 DOMWindowPagePopup::install(*frame->domWindow(), m_popupClient); | 253 DOMWindowPagePopup::install(*frame->localDOMWindow(), m_popupClient); |
254 ASSERT(m_popupClient->ownerElement().document().existingAXObjectCache() == f
rame->document()->existingAXObjectCache()); | 254 ASSERT(m_popupClient->ownerElement().document().existingAXObjectCache() == f
rame->document()->existingAXObjectCache()); |
255 | 255 |
256 RefPtr<SharedBuffer> data = SharedBuffer::create(); | 256 RefPtr<SharedBuffer> data = SharedBuffer::create(); |
257 m_popupClient->writeDocument(data.get()); | 257 m_popupClient->writeDocument(data.get()); |
258 frame->loader().load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "t
ext/html", "UTF-8", KURL(), ForceSynchronousLoad))); | 258 frame->loader().load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "t
ext/html", "UTF-8", KURL(), ForceSynchronousLoad))); |
259 return true; | 259 return true; |
260 } | 260 } |
261 | 261 |
262 void WebPagePopupImpl::destroyPage() | 262 void WebPagePopupImpl::destroyPage() |
263 { | 263 { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 m_closing = true; | 412 m_closing = true; |
413 destroyPage(); // In case closePopup() was not called. | 413 destroyPage(); // In case closePopup() was not called. |
414 m_widgetClient = 0; | 414 m_widgetClient = 0; |
415 deref(); | 415 deref(); |
416 } | 416 } |
417 | 417 |
418 void WebPagePopupImpl::closePopup() | 418 void WebPagePopupImpl::closePopup() |
419 { | 419 { |
420 if (m_page) { | 420 if (m_page) { |
421 toLocalFrame(m_page->mainFrame())->loader().stopAllLoaders(); | 421 toLocalFrame(m_page->mainFrame())->loader().stopAllLoaders(); |
422 ASSERT(m_page->mainFrame()->domWindow()); | 422 ASSERT(m_page->deprecatedLocalMainFrame()->localDOMWindow()); |
423 DOMWindowPagePopup::uninstall(*m_page->mainFrame()->domWindow()); | 423 DOMWindowPagePopup::uninstall(*m_page->deprecatedLocalMainFrame()->local
DOMWindow()); |
424 } | 424 } |
425 m_closing = true; | 425 m_closing = true; |
426 | 426 |
427 destroyPage(); | 427 destroyPage(); |
428 | 428 |
429 // m_widgetClient might be 0 because this widget might be already closed. | 429 // m_widgetClient might be 0 because this widget might be already closed. |
430 if (m_widgetClient) { | 430 if (m_widgetClient) { |
431 // closeWidgetSoon() will call this->close() later. | 431 // closeWidgetSoon() will call this->close() later. |
432 m_widgetClient->closeWidgetSoon(); | 432 m_widgetClient->closeWidgetSoon(); |
433 } | 433 } |
434 | 434 |
435 m_popupClient->didClosePopup(); | 435 m_popupClient->didClosePopup(); |
436 } | 436 } |
437 | 437 |
438 LocalDOMWindow* WebPagePopupImpl::window() | 438 LocalDOMWindow* WebPagePopupImpl::window() |
439 { | 439 { |
440 return m_page->mainFrame()->domWindow(); | 440 return m_page->deprecatedLocalMainFrame()->localDOMWindow(); |
441 } | 441 } |
442 | 442 |
443 void WebPagePopupImpl::compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCal
lback* callback) | 443 void WebPagePopupImpl::compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCal
lback* callback) |
444 { | 444 { |
445 ASSERT(isAcceleratedCompositingActive()); | 445 ASSERT(isAcceleratedCompositingActive()); |
446 m_layerTreeView->compositeAndReadbackAsync(callback); | 446 m_layerTreeView->compositeAndReadbackAsync(callback); |
447 } | 447 } |
448 | 448 |
449 WebPoint WebPagePopupImpl::positionRelativeToOwner() | 449 WebPoint WebPagePopupImpl::positionRelativeToOwner() |
450 { | 450 { |
(...skipping 10 matching lines...) Expand all Loading... |
461 // A WebPagePopupImpl instance usually has two references. | 461 // A WebPagePopupImpl instance usually has two references. |
462 // - One owned by the instance itself. It represents the visible widget. | 462 // - One owned by the instance itself. It represents the visible widget. |
463 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 463 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
464 // WebPagePopupImpl to close. | 464 // WebPagePopupImpl to close. |
465 // We need them because the closing operation is asynchronous and the widget | 465 // We need them because the closing operation is asynchronous and the widget |
466 // can be closed while the WebViewImpl is unaware of it. | 466 // can be closed while the WebViewImpl is unaware of it. |
467 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 467 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
468 } | 468 } |
469 | 469 |
470 } // namespace blink | 470 } // namespace blink |
OLD | NEW |