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

Unified Diff: chrome/browser/chromeos/extensions/media_player_event_router.cc

Issue 10823439: Ash: Support "Next Song", "Previous Song", "Play/Pause" Multi Media buttons (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed nits Created 8 years, 4 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: chrome/browser/chromeos/extensions/media_player_event_router.cc
diff --git a/chrome/browser/chromeos/extensions/media_player_event_router.cc b/chrome/browser/chromeos/extensions/media_player_event_router.cc
index 9d3fbc6bc5caa0d6638843f493e3c2d6e7f4bfaf..c8aa4e87652aec88cbb01553309be4266062ce1e 100644
--- a/chrome/browser/chromeos/extensions/media_player_event_router.cc
+++ b/chrome/browser/chromeos/extensions/media_player_event_router.cc
@@ -21,10 +21,34 @@ void ExtensionMediaPlayerEventRouter::Init(Profile* profile) {
profile_ = profile;
}
+void ExtensionMediaPlayerEventRouter::NotifyNextTrack() {
+ if (profile_ && profile_->GetExtensionEventRouter()) {
+ scoped_ptr<ListValue> args(new ListValue());
+ profile_->GetExtensionEventRouter()->DispatchEventToRenderers(
+ "mediaPlayerPrivate.onNextTrack", args.Pass(), NULL, GURL());
asargent_no_longer_on_chrome 2012/08/21 22:20:26 Can you just put "new ListValue()" instead of havi
sschmitz 2012/08/22 00:11:55 The short answer is no. (see my email reply)
+ }
+}
+
void ExtensionMediaPlayerEventRouter::NotifyPlaylistChanged() {
if (profile_ && profile_->GetExtensionEventRouter()) {
scoped_ptr<ListValue> args(new ListValue());
profile_->GetExtensionEventRouter()->DispatchEventToRenderers(
- "mediaPlayerPrivate.onPlaylistChanged", args.Pass(), NULL, GURL());
+ "mediaPlayerPrivate.onPlaylistChanged", args.Pass(), NULL, GURL());
+ }
+}
+
+void ExtensionMediaPlayerEventRouter::NotifyPrevTrack() {
+ if (profile_ && profile_->GetExtensionEventRouter()) {
+ scoped_ptr<ListValue> args(new ListValue());
+ profile_->GetExtensionEventRouter()->DispatchEventToRenderers(
+ "mediaPlayerPrivate.onPrevTrack", args.Pass(), NULL, GURL());
+ }
+}
+
+void ExtensionMediaPlayerEventRouter::NotifyTogglePlayState() {
+ if (profile_ && profile_->GetExtensionEventRouter()) {
+ scoped_ptr<ListValue> args(new ListValue());
+ profile_->GetExtensionEventRouter()->DispatchEventToRenderers(
+ "mediaPlayerPrivate.onTogglePlayState", args.Pass(), NULL, GURL());
}
}

Powered by Google App Engine
This is Rietveld 408576698