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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/Presentation.cpp

Issue 2592073002: Replace DOMWindowProperty in modules/presentation/ with ContextClient (Closed)
Patch Set: Created 4 years 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/presentation/Presentation.h" 5 #include "modules/presentation/Presentation.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "modules/presentation/PresentationController.h" 10 #include "modules/presentation/PresentationController.h"
11 #include "modules/presentation/PresentationReceiver.h" 11 #include "modules/presentation/PresentationReceiver.h"
12 #include "modules/presentation/PresentationRequest.h" 12 #include "modules/presentation/PresentationRequest.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 Presentation::Presentation(LocalFrame* frame) : DOMWindowProperty(frame) {} 16 Presentation::Presentation(LocalFrame* frame) : ContextClient(frame) {}
17 17
18 // static 18 // static
19 Presentation* Presentation::create(LocalFrame* frame) { 19 Presentation* Presentation::create(LocalFrame* frame) {
20 ASSERT(frame); 20 ASSERT(frame);
21 21
22 Presentation* presentation = new Presentation(frame); 22 Presentation* presentation = new Presentation(frame);
23 PresentationController* controller = PresentationController::from(*frame); 23 PresentationController* controller = PresentationController::from(*frame);
24 ASSERT(controller); 24 ASSERT(controller);
25 controller->setPresentation(presentation); 25 controller->setPresentation(presentation);
26 return presentation; 26 return presentation;
27 } 27 }
28 28
29 DEFINE_TRACE(Presentation) { 29 DEFINE_TRACE(Presentation) {
30 visitor->trace(m_defaultRequest); 30 visitor->trace(m_defaultRequest);
31 visitor->trace(m_receiver); 31 visitor->trace(m_receiver);
32 DOMWindowProperty::trace(visitor); 32 ContextClient::trace(visitor);
33 } 33 }
34 34
35 PresentationRequest* Presentation::defaultRequest() const { 35 PresentationRequest* Presentation::defaultRequest() const {
36 return m_defaultRequest; 36 return m_defaultRequest;
37 } 37 }
38 38
39 void Presentation::setDefaultRequest(PresentationRequest* request) { 39 void Presentation::setDefaultRequest(PresentationRequest* request) {
40 m_defaultRequest = request; 40 m_defaultRequest = request;
41 41
42 if (!frame()) 42 if (!frame())
(...skipping 15 matching lines...) Expand all
58 if (!m_receiver) { 58 if (!m_receiver) {
59 PresentationController* controller = PresentationController::from(*frame()); 59 PresentationController* controller = PresentationController::from(*frame());
60 auto* client = controller ? controller->client() : nullptr; 60 auto* client = controller ? controller->client() : nullptr;
61 m_receiver = new PresentationReceiver(frame(), client); 61 m_receiver = new PresentationReceiver(frame(), client);
62 } 62 }
63 63
64 return m_receiver; 64 return m_receiver;
65 } 65 }
66 66
67 } // namespace blink 67 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698