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

Unified Diff: Source/modules/presentation/PresentationSession.cpp

Issue 1015903002: [Presentation API] Adds close method to Presentation session. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
Index: Source/modules/presentation/PresentationSession.cpp
diff --git a/Source/modules/presentation/PresentationSession.cpp b/Source/modules/presentation/PresentationSession.cpp
index 03ac8d4cb0c029fe14854bc4e4bdaa7b1d9f7dd3..17d11d37fbae0a849476113209118d1de45028bf 100644
--- a/Source/modules/presentation/PresentationSession.cpp
+++ b/Source/modules/presentation/PresentationSession.cpp
@@ -9,6 +9,7 @@
#include "core/frame/LocalFrame.h"
#include "modules/EventTargetModules.h"
#include "modules/presentation/Presentation.h"
+#include "modules/presentation/PresentationController.h"
#include "public/platform/WebString.h"
#include "public/platform/modules/presentation/WebPresentationSessionClient.h"
#include "wtf/OwnPtr.h"
@@ -67,6 +68,17 @@ void PresentationSession::postMessage(const String& message)
void PresentationSession::close()
{
+ PresentationController* controller = presentationController();
+ if (controller) {
whywhat 2015/03/17 23:35:19 nit: remove the braces
haibinlu 2015/03/18 00:58:22 Done.
+ controller->closeSession(m_id);
+ }
+}
+
+PresentationController* PresentationSession::presentationController()
+{
+ if (!frame())
+ return nullptr;
+ return PresentationController::from(*frame());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698