Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "config.h" | 5 #include "config.h" |
| 6 #include "modules/presentation/PresentationSession.h" | 6 #include "modules/presentation/PresentationSession.h" |
| 7 | 7 |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "modules/EventTargetModules.h" | 10 #include "modules/EventTargetModules.h" |
| 11 #include "modules/presentation/Presentation.h" | 11 #include "modules/presentation/Presentation.h" |
| 12 #include "modules/presentation/PresentationController.h" | |
| 12 #include "public/platform/WebString.h" | 13 #include "public/platform/WebString.h" |
| 13 #include "public/platform/modules/presentation/WebPresentationSessionClient.h" | 14 #include "public/platform/modules/presentation/WebPresentationSessionClient.h" |
| 14 #include "wtf/OwnPtr.h" | 15 #include "wtf/OwnPtr.h" |
| 15 | 16 |
| 16 namespace blink { | 17 namespace blink { |
| 17 | 18 |
| 18 PresentationSession::PresentationSession(LocalFrame* frame, const WebString& id) | 19 PresentationSession::PresentationSession(LocalFrame* frame, const WebString& id) |
| 19 : DOMWindowProperty(frame) | 20 : DOMWindowProperty(frame) |
| 20 , m_id(id) | 21 , m_id(id) |
| 21 , m_state("disconnected") | 22 , m_state("disconnected") |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 RefCountedGarbageCollectedEventTargetWithInlineData<PresentationSession>::tr ace(visitor); | 61 RefCountedGarbageCollectedEventTargetWithInlineData<PresentationSession>::tr ace(visitor); |
| 61 DOMWindowProperty::trace(visitor); | 62 DOMWindowProperty::trace(visitor); |
| 62 } | 63 } |
| 63 | 64 |
| 64 void PresentationSession::postMessage(const String& message) | 65 void PresentationSession::postMessage(const String& message) |
| 65 { | 66 { |
| 66 } | 67 } |
| 67 | 68 |
| 68 void PresentationSession::close() | 69 void PresentationSession::close() |
| 69 { | 70 { |
| 71 PresentationController* controller = presentationController(); | |
| 72 if (controller) { | |
|
whywhat
2015/03/17 23:35:19
nit: remove the braces
haibinlu
2015/03/18 00:58:22
Done.
| |
| 73 controller->closeSession(m_id); | |
| 74 } | |
| 75 } | |
| 76 | |
| 77 PresentationController* PresentationSession::presentationController() | |
| 78 { | |
| 79 if (!frame()) | |
| 80 return nullptr; | |
| 81 return PresentationController::from(*frame()); | |
| 70 } | 82 } |
| 71 | 83 |
| 72 } // namespace blink | 84 } // namespace blink |
| OLD | NEW |