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

Side by Side Diff: third_party/WebKit/Source/core/page/PagePopupSupplement.cpp

Issue 1685003002: Plumb the correct owner document through DocumentInit::m_owner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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 10 matching lines...) Expand all
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "core/page/DOMWindowPagePopup.h" 31 #include "core/page/PagePopupSupplement.h"
32 32
33 #include "core/frame/LocalDOMWindow.h"
34 #include "core/page/PagePopupController.h" 33 #include "core/page/PagePopupController.h"
35 34
36 namespace blink { 35 namespace blink {
37 36
38 DOMWindowPagePopup::DOMWindowPagePopup(PagePopup& popup, PagePopupClient* popupC lient) 37 PagePopupSupplement::PagePopupSupplement(PagePopup& popup, PagePopupClient* popu pClient)
39 : m_controller(PagePopupController::create(popup, popupClient)) 38 : m_controller(PagePopupController::create(popup, popupClient))
40 { 39 {
41 ASSERT(popupClient); 40 ASSERT(popupClient);
42 } 41 }
43 42
44 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowPagePopup); 43 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(PagePopupSupplement);
45 44
46 const char* DOMWindowPagePopup::supplementName() 45 const char* PagePopupSupplement::supplementName()
47 { 46 {
48 return "DOMWindowPagePopup"; 47 return "PagePopupSupplement";
49 } 48 }
50 49
51 PagePopupController* DOMWindowPagePopup::pagePopupController(DOMWindow& window) 50 PagePopupController* PagePopupSupplement::pagePopupController(LocalFrame& frame)
52 { 51 {
53 DOMWindowPagePopup* supplement = static_cast<DOMWindowPagePopup*>(from(&toLo calDOMWindow(window), supplementName())); 52 PagePopupSupplement* supplement = static_cast<PagePopupSupplement*>(from(&fr ame, supplementName()));
54 ASSERT(supplement); 53 ASSERT(supplement);
55 return supplement->m_controller.get(); 54 return supplement->m_controller.get();
56 } 55 }
57 56
58 void DOMWindowPagePopup::install(LocalDOMWindow& window, PagePopup& popup, PageP opupClient* popupClient) 57 void PagePopupSupplement::install(LocalFrame& frame, PagePopup& popup, PagePopup Client* popupClient)
59 { 58 {
60 ASSERT(popupClient); 59 ASSERT(popupClient);
61 provideTo(window, supplementName(), adoptPtrWillBeNoop(new DOMWindowPagePopu p(popup, popupClient))); 60 provideTo(frame, supplementName(), adoptPtrWillBeNoop(new PagePopupSupplemen t(popup, popupClient)));
62 } 61 }
63 62
64 void DOMWindowPagePopup::uninstall(LocalDOMWindow& window) 63 void PagePopupSupplement::uninstall(LocalFrame& frame)
65 { 64 {
66 pagePopupController(window)->clearPagePopupClient(); 65 pagePopupController(frame)->clearPagePopupClient();
67 window.removeSupplement(supplementName()); 66 frame.removeSupplement(supplementName());
68 } 67 }
69 68
70 DEFINE_TRACE(DOMWindowPagePopup) 69 DEFINE_TRACE(PagePopupSupplement)
71 { 70 {
72 visitor->trace(m_controller); 71 visitor->trace(m_controller);
73 WillBeHeapSupplement<LocalDOMWindow>::trace(visitor); 72 WillBeHeapSupplement<LocalFrame>::trace(visitor);
74 } 73 }
75 74
76 } // namespace blink 75 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698