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

Unified Diff: third_party/WebKit/Source/modules/presentation/Presentation.cpp

Issue 2500273003: Presentation API: add settings for presentation.receiver being exposed. (Closed)
Patch Set: update property-access-tests and rebase Created 4 years, 1 month 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: third_party/WebKit/Source/modules/presentation/Presentation.cpp
diff --git a/third_party/WebKit/Source/modules/presentation/Presentation.cpp b/third_party/WebKit/Source/modules/presentation/Presentation.cpp
index aa15f73e031d3796661a692a3ff9141cf974984c..8a3e16adae0692710e19bc76d58210d09b634497 100644
--- a/third_party/WebKit/Source/modules/presentation/Presentation.cpp
+++ b/third_party/WebKit/Source/modules/presentation/Presentation.cpp
@@ -6,6 +6,7 @@
#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/Settings.h"
#include "modules/presentation/PresentationController.h"
#include "modules/presentation/PresentationReceiver.h"
#include "modules/presentation/PresentationRequest.h"
@@ -48,16 +49,18 @@ void Presentation::setDefaultRequest(PresentationRequest* request) {
}
PresentationReceiver* Presentation::receiver() {
- if (!frame())
+ if (!frame() || !frame()->settings())
+ return nullptr;
+
+ if (!frame()->settings()->presentationReceiver())
return nullptr;
- // TODO(crbug.com/647296): only return something if the Blink instance is
- // running in presentation receiver mode. The flag PresentationReceiver could
- // be used for that.
+
if (!m_receiver) {
PresentationController* controller = PresentationController::from(*frame());
auto* client = controller ? controller->client() : nullptr;
m_receiver = new PresentationReceiver(frame(), client);
}
+
return m_receiver;
}
« no previous file with comments | « third_party/WebKit/Source/core/testing/InternalSettings.idl ('k') | third_party/WebKit/Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698