Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: third_party/WebKit/Source/web/WebPagePopupImpl.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" 56 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h"
57 #include "public/platform/WebCursorInfo.h" 57 #include "public/platform/WebCursorInfo.h"
58 #include "public/web/WebAXObject.h" 58 #include "public/web/WebAXObject.h"
59 #include "public/web/WebFrameClient.h" 59 #include "public/web/WebFrameClient.h"
60 #include "public/web/WebViewClient.h" 60 #include "public/web/WebViewClient.h"
61 #include "public/web/WebWidgetClient.h" 61 #include "public/web/WebWidgetClient.h"
62 #include "web/WebInputEventConversion.h" 62 #include "web/WebInputEventConversion.h"
63 #include "web/WebLocalFrameImpl.h" 63 #include "web/WebLocalFrameImpl.h"
64 #include "web/WebSettingsImpl.h" 64 #include "web/WebSettingsImpl.h"
65 #include "web/WebViewImpl.h" 65 #include "web/WebViewImpl.h"
66 #include "wtf/PtrUtil.h"
67 66
68 namespace blink { 67 namespace blink {
69 68
70 class PagePopupChromeClient final : public EmptyChromeClient { 69 class PagePopupChromeClient final : public EmptyChromeClient {
71 public: 70 public:
72 static PagePopupChromeClient* create(WebPagePopupImpl* popup) 71 static PagePopupChromeClient* create(WebPagePopupImpl* popup)
73 { 72 {
74 return new PagePopupChromeClient(popup); 73 return new PagePopupChromeClient(popup);
75 } 74 }
76 75
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 pageClients.chromeClient = m_chromeClient.get(); 277 pageClients.chromeClient = m_chromeClient.get();
279 278
280 m_page = Page::create(pageClients); 279 m_page = Page::create(pageClients);
281 m_page->settings().setScriptEnabled(true); 280 m_page->settings().setScriptEnabled(true);
282 m_page->settings().setAllowScriptsToCloseWindows(true); 281 m_page->settings().setAllowScriptsToCloseWindows(true);
283 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi ceSupportsTouch()); 282 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi ceSupportsTouch());
284 // FIXME: Should we support enabling a11y while a popup is shown? 283 // FIXME: Should we support enabling a11y while a popup is shown?
285 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc essibilityEnabled()); 284 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc essibilityEnabled());
286 m_page->settings().setScrollAnimatorEnabled(m_webView->page()->settings().sc rollAnimatorEnabled()); 285 m_page->settings().setScrollAnimatorEnabled(m_webView->page()->settings().sc rollAnimatorEnabled());
287 286
288 provideContextFeaturesTo(*m_page, wrapUnique(new PagePopupFeaturesClient())) ; 287 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient()));
289 DEFINE_STATIC_LOCAL(FrameLoaderClient, emptyFrameLoaderClient, (EmptyFrameLo aderClient::create())); 288 DEFINE_STATIC_LOCAL(FrameLoaderClient, emptyFrameLoaderClient, (EmptyFrameLo aderClient::create()));
290 LocalFrame* frame = LocalFrame::create(&emptyFrameLoaderClient, &m_page->fra meHost(), 0); 289 LocalFrame* frame = LocalFrame::create(&emptyFrameLoaderClient, &m_page->fra meHost(), 0);
291 frame->setPagePopupOwner(m_popupClient->ownerElement()); 290 frame->setPagePopupOwner(m_popupClient->ownerElement());
292 frame->setView(FrameView::create(frame)); 291 frame->setView(FrameView::create(frame));
293 frame->init(); 292 frame->init();
294 frame->view()->setParentVisible(true); 293 frame->view()->setParentVisible(true);
295 frame->view()->setSelfVisible(true); 294 frame->view()->setSelfVisible(true);
296 frame->view()->setTransparent(false); 295 frame->view()->setTransparent(false);
297 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing AXObjectCache()) 296 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing AXObjectCache())
298 cache->childrenChanged(&m_popupClient->ownerElement()); 297 cache->childrenChanged(&m_popupClient->ownerElement());
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 // A WebPagePopupImpl instance usually has two references. 582 // A WebPagePopupImpl instance usually has two references.
584 // - One owned by the instance itself. It represents the visible widget. 583 // - One owned by the instance itself. It represents the visible widget.
585 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the 584 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the
586 // WebPagePopupImpl to close. 585 // WebPagePopupImpl to close.
587 // We need them because the closing operation is asynchronous and the widget 586 // We need them because the closing operation is asynchronous and the widget
588 // can be closed while the WebViewImpl is unaware of it. 587 // can be closed while the WebViewImpl is unaware of it.
589 return adoptRef(new WebPagePopupImpl(client)).leakRef(); 588 return adoptRef(new WebPagePopupImpl(client)).leakRef();
590 } 589 }
591 590
592 } // namespace blink 591 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebPagePopupImpl.h ('k') | third_party/WebKit/Source/web/WebPepperSocket.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698