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

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

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. 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"
66 67
67 namespace blink { 68 namespace blink {
68 69
69 class PagePopupChromeClient final : public EmptyChromeClient { 70 class PagePopupChromeClient final : public EmptyChromeClient {
70 public: 71 public:
71 static PagePopupChromeClient* create(WebPagePopupImpl* popup) 72 static PagePopupChromeClient* create(WebPagePopupImpl* popup)
72 { 73 {
73 return new PagePopupChromeClient(popup); 74 return new PagePopupChromeClient(popup);
74 } 75 }
75 76
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 pageClients.chromeClient = m_chromeClient.get(); 278 pageClients.chromeClient = m_chromeClient.get();
278 279
279 m_page = Page::create(pageClients); 280 m_page = Page::create(pageClients);
280 m_page->settings().setScriptEnabled(true); 281 m_page->settings().setScriptEnabled(true);
281 m_page->settings().setAllowScriptsToCloseWindows(true); 282 m_page->settings().setAllowScriptsToCloseWindows(true);
282 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi ceSupportsTouch()); 283 m_page->settings().setDeviceSupportsTouch(m_webView->page()->settings().devi ceSupportsTouch());
283 // FIXME: Should we support enabling a11y while a popup is shown? 284 // FIXME: Should we support enabling a11y while a popup is shown?
284 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc essibilityEnabled()); 285 m_page->settings().setAccessibilityEnabled(m_webView->page()->settings().acc essibilityEnabled());
285 m_page->settings().setScrollAnimatorEnabled(m_webView->page()->settings().sc rollAnimatorEnabled()); 286 m_page->settings().setScrollAnimatorEnabled(m_webView->page()->settings().sc rollAnimatorEnabled());
286 287
287 provideContextFeaturesTo(*m_page, adoptPtr(new PagePopupFeaturesClient())); 288 provideContextFeaturesTo(*m_page, wrapUnique(new PagePopupFeaturesClient())) ;
288 DEFINE_STATIC_LOCAL(FrameLoaderClient, emptyFrameLoaderClient, (EmptyFrameLo aderClient::create())); 289 DEFINE_STATIC_LOCAL(FrameLoaderClient, emptyFrameLoaderClient, (EmptyFrameLo aderClient::create()));
289 LocalFrame* frame = LocalFrame::create(&emptyFrameLoaderClient, &m_page->fra meHost(), 0); 290 LocalFrame* frame = LocalFrame::create(&emptyFrameLoaderClient, &m_page->fra meHost(), 0);
290 frame->setPagePopupOwner(m_popupClient->ownerElement()); 291 frame->setPagePopupOwner(m_popupClient->ownerElement());
291 frame->setView(FrameView::create(frame)); 292 frame->setView(FrameView::create(frame));
292 frame->init(); 293 frame->init();
293 frame->view()->setParentVisible(true); 294 frame->view()->setParentVisible(true);
294 frame->view()->setSelfVisible(true); 295 frame->view()->setSelfVisible(true);
295 frame->view()->setTransparent(false); 296 frame->view()->setTransparent(false);
296 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing AXObjectCache()) 297 if (AXObjectCache* cache = m_popupClient->ownerElement().document().existing AXObjectCache())
297 cache->childrenChanged(&m_popupClient->ownerElement()); 298 cache->childrenChanged(&m_popupClient->ownerElement());
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 // A WebPagePopupImpl instance usually has two references. 583 // A WebPagePopupImpl instance usually has two references.
583 // - One owned by the instance itself. It represents the visible widget. 584 // - One owned by the instance itself. It represents the visible widget.
584 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the 585 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the
585 // WebPagePopupImpl to close. 586 // WebPagePopupImpl to close.
586 // We need them because the closing operation is asynchronous and the widget 587 // We need them because the closing operation is asynchronous and the widget
587 // can be closed while the WebViewImpl is unaware of it. 588 // can be closed while the WebViewImpl is unaware of it.
588 return adoptRef(new WebPagePopupImpl(client)).leakRef(); 589 return adoptRef(new WebPagePopupImpl(client)).leakRef();
589 } 590 }
590 591
591 } // namespace blink 592 } // 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