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

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

Issue 1020303004: [PresentationAPI] Plumbing |onstatechange| event for the PresentationSession from Blink to platform/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added a return statement for the conversion function 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.h
diff --git a/Source/modules/presentation/PresentationSession.h b/Source/modules/presentation/PresentationSession.h
index e3050dc89c5a0ebc5b6af2e8949b68a74d4ee80f..1fc4c309f8a8c8b0dbfa5ba1515fba0a31d0da8d 100644
--- a/Source/modules/presentation/PresentationSession.h
+++ b/Source/modules/presentation/PresentationSession.h
@@ -7,15 +7,17 @@
#include "core/events/EventTarget.h"
#include "core/frame/DOMWindowProperty.h"
-#include "wtf/text/AtomicString.h"
+#include "public/platform/modules/presentation/WebPresentationSessionClient.h"
#include "wtf/text/WTFString.h"
+namespace WTF {
+class AtomicString;
+} // namespace WTF
+
namespace blink {
class Presentation;
class PresentationController;
-class WebPresentationSessionClient;
-class WebString;
class PresentationSession final
: public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationSession>
@@ -34,8 +36,8 @@ public:
DECLARE_VIRTUAL_TRACE();
- const String& id() const { return m_id; }
- const AtomicString& state() const { return m_state; }
+ const String id() const { return m_id; }
+ const WTF::AtomicString& state() const;
void postMessage(const String& message);
void close();
@@ -43,8 +45,14 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(message);
DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange);
+ // Returns true if and only if the WebPresentationSessionClient represents this session.
+ bool matches(WebPresentationSessionClient*) const;
+
+ // Notifies the session about its state change.
+ void didChangeState(WebPresentationSessionState);
+
private:
- PresentationSession(LocalFrame*, const WebString& id, const WebString& url);
+ PresentationSession(LocalFrame*, const String& id, const String& url);
// Returns the |PresentationController| object associated with the frame
// |Presentation| corresponds to. Can return |nullptr| if the frame is
@@ -53,7 +61,7 @@ private:
String m_id;
String m_url;
- AtomicString m_state;
+ WebPresentationSessionState m_state;
};
} // namespace blink
« no previous file with comments | « Source/modules/presentation/PresentationController.cpp ('k') | Source/modules/presentation/PresentationSession.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698