| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 270 |
| 271 m_page = Page::create(pageClients); | 271 m_page = Page::create(pageClients); |
| 272 m_page->settings().setScriptEnabled(true); | 272 m_page->settings().setScriptEnabled(true); |
| 273 m_page->settings().setAllowScriptsToCloseWindows(true); | 273 m_page->settings().setAllowScriptsToCloseWindows(true); |
| 274 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi
ceSupportsTouch()); | 274 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi
ceSupportsTouch()); |
| 275 // FIXME: Should we support enabling a11y while a popup is shown? | 275 // FIXME: Should we support enabling a11y while a popup is shown? |
| 276 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc
essibilityEnabled()); | 276 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc
essibilityEnabled()); |
| 277 m_page->settings().setScrollAnimatorEnabled(m_webView->page()->settings().sc
rollAnimatorEnabled()); | 277 m_page->settings().setScrollAnimatorEnabled(m_webView->page()->settings().sc
rollAnimatorEnabled()); |
| 278 | 278 |
| 279 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient())); | 279 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient())); |
| 280 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<FrameLoaderClient>, emptyFrameLoa
derClient, (EmptyFrameLoaderClient::create())); | 280 DEFINE_STATIC_LOCAL(Persistent<FrameLoaderClient>, emptyFrameLoaderClient, (
EmptyFrameLoaderClient::create())); |
| 281 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderCl
ient.get(), &m_page->frameHost(), 0); | 281 RawPtr<LocalFrame> frame = LocalFrame::create(emptyFrameLoaderClient.get(),
&m_page->frameHost(), 0); |
| 282 frame->setPagePopupOwner(m_popupClient->ownerElement()); | 282 frame->setPagePopupOwner(m_popupClient->ownerElement()); |
| 283 frame->setView(FrameView::create(frame.get())); | 283 frame->setView(FrameView::create(frame.get())); |
| 284 frame->init(); | 284 frame->init(); |
| 285 frame->view()->setParentVisible(true); | 285 frame->view()->setParentVisible(true); |
| 286 frame->view()->setSelfVisible(true); | 286 frame->view()->setSelfVisible(true); |
| 287 frame->view()->setTransparent(false); | 287 frame->view()->setTransparent(false); |
| 288 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing
AXObjectCache()) | 288 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing
AXObjectCache()) |
| 289 cache->childrenChanged(&m_popupClient->ownerElement()); | 289 cache->childrenChanged(&m_popupClient->ownerElement()); |
| 290 | 290 |
| 291 ASSERT(frame->localDOMWindow()); | 291 ASSERT(frame->localDOMWindow()); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 // A WebPagePopupImpl instance usually has two references. | 560 // A WebPagePopupImpl instance usually has two references. |
| 561 // - One owned by the instance itself. It represents the visible widget. | 561 // - One owned by the instance itself. It represents the visible widget. |
| 562 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 562 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
| 563 // WebPagePopupImpl to close. | 563 // WebPagePopupImpl to close. |
| 564 // We need them because the closing operation is asynchronous and the widget | 564 // We need them because the closing operation is asynchronous and the widget |
| 565 // can be closed while the WebViewImpl is unaware of it. | 565 // can be closed while the WebViewImpl is unaware of it. |
| 566 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 566 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 567 } | 567 } |
| 568 | 568 |
| 569 } // namespace blink | 569 } // namespace blink |
| OLD | NEW |