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

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: Addressed the comments, changed the enum to enum class. 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..c2778d588dc3073f9262c595dca9d3b9a1a60e10 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 "wtf/text/WTFString.h"
+#include "public/platform/WebString.h"
+#include "public/platform/modules/presentation/WebPresentationSessionClient.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,6 +45,12 @@ 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);
@@ -51,9 +59,9 @@ private:
// detached from the document.
PresentationController* presentationController();
- String m_id;
- String m_url;
- AtomicString m_state;
+ WebString m_id;
+ WebString m_url;
mlamouri (slow - plz ping) 2015/03/23 21:25:48 I think you should keep String here. WebString are
whywhat 2015/03/23 21:37:45 Done.
+ WebPresentationSessionState m_state;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698