| 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 24 matching lines...) Expand all Loading... |
| 35 #include "core/page/PagePopupController.h" | 35 #include "core/page/PagePopupController.h" |
| 36 | 36 |
| 37 namespace WebCore { | 37 namespace WebCore { |
| 38 | 38 |
| 39 DOMWindowPagePopup::DOMWindowPagePopup(PagePopupClient* popupClient) | 39 DOMWindowPagePopup::DOMWindowPagePopup(PagePopupClient* popupClient) |
| 40 : m_controller(PagePopupController::create(popupClient)) | 40 : m_controller(PagePopupController::create(popupClient)) |
| 41 { | 41 { |
| 42 ASSERT(popupClient); | 42 ASSERT(popupClient); |
| 43 } | 43 } |
| 44 | 44 |
| 45 DOMWindowPagePopup::~DOMWindowPagePopup() | 45 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowPagePopup); |
| 46 { | |
| 47 m_controller->clearPagePopupClient(); | |
| 48 } | |
| 49 | 46 |
| 50 const char* DOMWindowPagePopup::supplementName() | 47 const char* DOMWindowPagePopup::supplementName() |
| 51 { | 48 { |
| 52 return "DOMWindowPagePopup"; | 49 return "DOMWindowPagePopup"; |
| 53 } | 50 } |
| 54 | 51 |
| 55 PagePopupController* DOMWindowPagePopup::pagePopupController(DOMWindow& window) | 52 PagePopupController* DOMWindowPagePopup::pagePopupController(DOMWindow& window) |
| 56 { | 53 { |
| 57 DOMWindowPagePopup* supplement = static_cast<DOMWindowPagePopup*>(from(&wind
ow, supplementName())); | 54 DOMWindowPagePopup* supplement = static_cast<DOMWindowPagePopup*>(from(&wind
ow, supplementName())); |
| 58 ASSERT(supplement); | 55 ASSERT(supplement); |
| 59 return supplement->m_controller.get(); | 56 return supplement->m_controller.get(); |
| 60 } | 57 } |
| 61 | 58 |
| 62 void DOMWindowPagePopup::install(DOMWindow& window, PagePopupClient* popupClient
) | 59 void DOMWindowPagePopup::install(DOMWindow& window, PagePopupClient* popupClient
) |
| 63 { | 60 { |
| 64 ASSERT(popupClient); | 61 ASSERT(popupClient); |
| 65 provideTo(window, supplementName(), adoptPtr(new DOMWindowPagePopup(popupCli
ent))); | 62 provideTo(window, supplementName(), adoptPtrWillBeNoop(new DOMWindowPagePopu
p(popupClient))); |
| 66 } | 63 } |
| 67 | 64 |
| 68 void DOMWindowPagePopup::uninstall(DOMWindow& window) | 65 void DOMWindowPagePopup::uninstall(DOMWindow& window) |
| 69 { | 66 { |
| 67 pagePopupController(window)->clearPagePopupClient(); |
| 70 window.removeSupplement(supplementName()); | 68 window.removeSupplement(supplementName()); |
| 71 } | 69 } |
| 72 | 70 |
| 71 void DOMWindowPagePopup::trace(Visitor* visitor) |
| 72 { |
| 73 visitor->trace(m_controller); |
| 73 } | 74 } |
| 75 |
| 76 } |
| OLD | NEW |