| 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 22 matching lines...) Expand all Loading... |
| 33 #include "core/page/PagePopupController.h" | 33 #include "core/page/PagePopupController.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 PagePopupSupplement::PagePopupSupplement(PagePopup& popup, PagePopupClient* popu
pClient) | 37 PagePopupSupplement::PagePopupSupplement(PagePopup& popup, PagePopupClient* popu
pClient) |
| 38 : m_controller(PagePopupController::create(popup, popupClient)) | 38 : m_controller(PagePopupController::create(popup, popupClient)) |
| 39 { | 39 { |
| 40 ASSERT(popupClient); | 40 ASSERT(popupClient); |
| 41 } | 41 } |
| 42 | 42 |
| 43 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(PagePopupSupplement); | |
| 44 | |
| 45 const char* PagePopupSupplement::supplementName() | 43 const char* PagePopupSupplement::supplementName() |
| 46 { | 44 { |
| 47 return "PagePopupSupplement"; | 45 return "PagePopupSupplement"; |
| 48 } | 46 } |
| 49 | 47 |
| 50 PagePopupController* PagePopupSupplement::pagePopupController(LocalFrame& frame) | 48 PagePopupController* PagePopupSupplement::pagePopupController(LocalFrame& frame) |
| 51 { | 49 { |
| 52 PagePopupSupplement* supplement = static_cast<PagePopupSupplement*>(from(&fr
ame, supplementName())); | 50 PagePopupSupplement* supplement = static_cast<PagePopupSupplement*>(from(&fr
ame, supplementName())); |
| 53 ASSERT(supplement); | 51 ASSERT(supplement); |
| 54 return supplement->m_controller.get(); | 52 return supplement->m_controller.get(); |
| 55 } | 53 } |
| 56 | 54 |
| 57 void PagePopupSupplement::install(LocalFrame& frame, PagePopup& popup, PagePopup
Client* popupClient) | 55 void PagePopupSupplement::install(LocalFrame& frame, PagePopup& popup, PagePopup
Client* popupClient) |
| 58 { | 56 { |
| 59 ASSERT(popupClient); | 57 ASSERT(popupClient); |
| 60 provideTo(frame, supplementName(), adoptPtrWillBeNoop(new PagePopupSupplemen
t(popup, popupClient))); | 58 provideTo(frame, supplementName(), new PagePopupSupplement(popup, popupClien
t)); |
| 61 } | 59 } |
| 62 | 60 |
| 63 void PagePopupSupplement::uninstall(LocalFrame& frame) | 61 void PagePopupSupplement::uninstall(LocalFrame& frame) |
| 64 { | 62 { |
| 65 pagePopupController(frame)->clearPagePopupClient(); | 63 pagePopupController(frame)->clearPagePopupClient(); |
| 66 frame.removeSupplement(supplementName()); | 64 frame.removeSupplement(supplementName()); |
| 67 } | 65 } |
| 68 | 66 |
| 69 DEFINE_TRACE(PagePopupSupplement) | 67 DEFINE_TRACE(PagePopupSupplement) |
| 70 { | 68 { |
| 71 visitor->trace(m_controller); | 69 visitor->trace(m_controller); |
| 72 WillBeHeapSupplement<LocalFrame>::trace(visitor); | 70 HeapSupplement<LocalFrame>::trace(visitor); |
| 73 } | 71 } |
| 74 | 72 |
| 75 } // namespace blink | 73 } // namespace blink |
| OLD | NEW |