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

Unified Diff: third_party/WebKit/Source/core/page/PagePopupSupplement.cpp

Issue 2617113003: Use a new Supplement construtor in PagePopupController (Closed)
Patch Set: temp Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/page/PagePopupSupplement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/PagePopupSupplement.cpp
diff --git a/third_party/WebKit/Source/core/page/PagePopupSupplement.cpp b/third_party/WebKit/Source/core/page/PagePopupSupplement.cpp
index 7e4a6c7088e022703f0a791e3e583c9005cfc15c..23e1de63a9604293d6a05f4a8c21f046de54a5a2 100644
--- a/third_party/WebKit/Source/core/page/PagePopupSupplement.cpp
+++ b/third_party/WebKit/Source/core/page/PagePopupSupplement.cpp
@@ -34,22 +34,31 @@
namespace blink {
-PagePopupSupplement::PagePopupSupplement(PagePopup& popup,
+PagePopupSupplement::PagePopupSupplement(LocalFrame& frame,
+ PagePopup& popup,
PagePopupClient* popupClient)
- : m_controller(PagePopupController::create(popup, popupClient)) {
- ASSERT(popupClient);
+ : Supplement<LocalFrame>(frame),
+ m_controller(PagePopupController::create(popup, popupClient)) {
+ DCHECK(popupClient);
}
const char* PagePopupSupplement::supplementName() {
return "PagePopupSupplement";
}
-PagePopupController* PagePopupSupplement::pagePopupController(
- LocalFrame& frame) {
- PagePopupSupplement* supplement =
- static_cast<PagePopupSupplement*>(from(&frame, supplementName()));
- ASSERT(supplement);
- return supplement->m_controller.get();
+PagePopupSupplement& PagePopupSupplement::from(LocalFrame& frame) {
+ PagePopupSupplement* supplement = static_cast<PagePopupSupplement*>(
+ Supplement<LocalFrame>::from(&frame, supplementName()));
+ DCHECK(supplement);
+ return *supplement;
+}
+
+PagePopupController* PagePopupSupplement::pagePopupController() const {
+ return m_controller;
+}
+
+void PagePopupSupplement::dispose() {
+ m_controller->clearPagePopupClient();
}
void PagePopupSupplement::install(LocalFrame& frame,
@@ -57,11 +66,11 @@ void PagePopupSupplement::install(LocalFrame& frame,
PagePopupClient* popupClient) {
ASSERT(popupClient);
provideTo(frame, supplementName(),
- new PagePopupSupplement(popup, popupClient));
+ new PagePopupSupplement(frame, popup, popupClient));
}
void PagePopupSupplement::uninstall(LocalFrame& frame) {
- pagePopupController(frame)->clearPagePopupClient();
+ PagePopupSupplement::from(frame).dispose();
frame.removeSupplement(supplementName());
}
« no previous file with comments | « third_party/WebKit/Source/core/page/PagePopupSupplement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698