| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 #include "public/web/WebWidgetClient.h" | 60 #include "public/web/WebWidgetClient.h" |
| 61 #include "web/WebInputEventConversion.h" | 61 #include "web/WebInputEventConversion.h" |
| 62 #include "web/WebLocalFrameImpl.h" | 62 #include "web/WebLocalFrameImpl.h" |
| 63 #include "web/WebSettingsImpl.h" | 63 #include "web/WebSettingsImpl.h" |
| 64 #include "web/WebViewImpl.h" | 64 #include "web/WebViewImpl.h" |
| 65 | 65 |
| 66 namespace blink { | 66 namespace blink { |
| 67 | 67 |
| 68 class PagePopupChromeClient final : public EmptyChromeClient { | 68 class PagePopupChromeClient final : public EmptyChromeClient { |
| 69 public: | 69 public: |
| 70 static PassOwnPtrWillBeRawPtr<PagePopupChromeClient> create(WebPagePopupImpl
* popup) | 70 static RawPtr<PagePopupChromeClient> create(WebPagePopupImpl* popup) |
| 71 { | 71 { |
| 72 return adoptPtrWillBeNoop(new PagePopupChromeClient(popup)); | 72 return (new PagePopupChromeClient(popup)); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void setWindowRect(const IntRect& rect) override | 75 void setWindowRect(const IntRect& rect) override |
| 76 { | 76 { |
| 77 m_popup->setWindowRect(rect); | 77 m_popup->setWindowRect(rect); |
| 78 } | 78 } |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 explicit PagePopupChromeClient(WebPagePopupImpl* popup) | 81 explicit PagePopupChromeClient(WebPagePopupImpl* popup) |
| 82 : m_popup(popup) | 82 : m_popup(popup) |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 275 |
| 276 m_page = Page::create(pageClients); | 276 m_page = Page::create(pageClients); |
| 277 m_page->settings().setScriptEnabled(true); | 277 m_page->settings().setScriptEnabled(true); |
| 278 m_page->settings().setAllowScriptsToCloseWindows(true); | 278 m_page->settings().setAllowScriptsToCloseWindows(true); |
| 279 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi
ceSupportsTouch()); | 279 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi
ceSupportsTouch()); |
| 280 // FIXME: Should we support enabling a11y while a popup is shown? | 280 // FIXME: Should we support enabling a11y while a popup is shown? |
| 281 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc
essibilityEnabled()); | 281 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc
essibilityEnabled()); |
| 282 m_page->settings().setScrollAnimatorEnabled(m_webView->page()->settings().sc
rollAnimatorEnabled()); | 282 m_page->settings().setScrollAnimatorEnabled(m_webView->page()->settings().sc
rollAnimatorEnabled()); |
| 283 | 283 |
| 284 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient())); | 284 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient())); |
| 285 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<FrameLoaderClient>, emptyFrameLoa
derClient, (EmptyFrameLoaderClient::create())); | 285 DEFINE_STATIC_LOCAL(Persistent<FrameLoaderClient>, emptyFrameLoaderClient, (
EmptyFrameLoaderClient::create())); |
| 286 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderCl
ient.get(), &m_page->frameHost(), 0); | 286 RawPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderClient.get(),
&m_page->frameHost(), 0); |
| 287 frame->setPagePopupOwner(m_popupClient->ownerElement()); | 287 frame->setPagePopupOwner(m_popupClient->ownerElement()); |
| 288 frame->setView(FrameView::create(frame.get())); | 288 frame->setView(FrameView::create(frame.get())); |
| 289 frame->init(); | 289 frame->init(); |
| 290 frame->view()->setParentVisible(true); | 290 frame->view()->setParentVisible(true); |
| 291 frame->view()->setSelfVisible(true); | 291 frame->view()->setSelfVisible(true); |
| 292 frame->view()->setTransparent(false); | 292 frame->view()->setTransparent(false); |
| 293 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing
AXObjectCache()) | 293 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing
AXObjectCache()) |
| 294 cache->childrenChanged(&m_popupClient->ownerElement()); | 294 cache->childrenChanged(&m_popupClient->ownerElement()); |
| 295 | 295 |
| 296 ASSERT(frame->localDOMWindow()); | 296 ASSERT(frame->localDOMWindow()); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 // A WebPagePopupImpl instance usually has two references. | 567 // A WebPagePopupImpl instance usually has two references. |
| 568 // - One owned by the instance itself. It represents the visible widget. | 568 // - One owned by the instance itself. It represents the visible widget. |
| 569 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 569 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
| 570 // WebPagePopupImpl to close. | 570 // WebPagePopupImpl to close. |
| 571 // We need them because the closing operation is asynchronous and the widget | 571 // We need them because the closing operation is asynchronous and the widget |
| 572 // can be closed while the WebViewImpl is unaware of it. | 572 // can be closed while the WebViewImpl is unaware of it. |
| 573 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 573 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 574 } | 574 } |
| 575 | 575 |
| 576 } // namespace blink | 576 } // namespace blink |
| OLD | NEW |