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

Unified Diff: third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp

Issue 2415443004: [Blink, RemotePlayback]Split onstatechange to separate events (Closed)
Patch Set: Fixed global-interface-listing test Created 4 years, 2 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: third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
diff --git a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
index 26d31eee843ed698be30ba19768e30e255bd7119..ce0e0860c14e782d20161015f5cbc693f0185398 100644
--- a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
+++ b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
@@ -20,10 +20,13 @@ namespace blink {
namespace {
const AtomicString& remotePlaybackStateToString(WebRemotePlaybackState state) {
+ DEFINE_STATIC_LOCAL(const AtomicString, connectingValue, ("connecting"));
DEFINE_STATIC_LOCAL(const AtomicString, connectedValue, ("connected"));
DEFINE_STATIC_LOCAL(const AtomicString, disconnectedValue, ("disconnected"));
switch (state) {
+ case WebRemotePlaybackState::Connecting:
+ return connectingValue;
case WebRemotePlaybackState::Connected:
return connectedValue;
case WebRemotePlaybackState::Disconnected:
@@ -218,7 +221,17 @@ void RemotePlayback::stateChanged(WebRemotePlaybackState state) {
return;
m_state = state;
- dispatchEvent(Event::create(EventTypeNames::statechange));
+ switch (m_state) {
+ case WebRemotePlaybackState::Connecting:
+ dispatchEvent(Event::create(EventTypeNames::connecting));
+ break;
+ case WebRemotePlaybackState::Connected:
+ dispatchEvent(Event::create(EventTypeNames::connect));
+ break;
+ case WebRemotePlaybackState::Disconnected:
+ dispatchEvent(Event::create(EventTypeNames::disconnect));
+ break;
+ }
}
void RemotePlayback::availabilityChanged(bool available) {

Powered by Google App Engine
This is Rietveld 408576698