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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionAction.java

Issue 2441403002: Add media controls in media notification (Closed)
Patch Set: nits 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: chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionAction.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionAction.java b/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionAction.java
new file mode 100644
index 0000000000000000000000000000000000000000..db3b4fa007dc17e3087568faa12f862118b69518
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionAction.java
@@ -0,0 +1,45 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.media.ui;
+
+/**
+ * MediaSession action kind enum corresponding to blink::mojom::MediaSessionAction.
+ */
+public enum MediaSessionAction {
+ ACTION_PLAY(0),
+ ACTION_PAUSE(1),
+ ACTION_PLAY_PAUSE(2),
+ ACTION_PREVIOUS_TRACK(3),
+ ACTION_NEXT_TRACK(4),
+ ACTION_SEEK_FORWARD(5),
+ ACTION_SEEK_BACKWARD(6);
+
+ private final int mValue;
+
+ /**
+ * Converts an int to its equivalent MediaSessionAction.
+ * @param i The integer to convert.
+ * @return The enum that |i| corresponds to.
+ */
+ public static MediaSessionAction fromInt(int i) {
+ for (MediaSessionAction type : MediaSessionAction.values()) {
+ if (type.getValue() == i) {
+ return type;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @return The integer the enum corresponds to.
+ */
+ public int getValue() {
+ return mValue;
+ }
+
+ private MediaSessionAction(int value) {
+ mValue = value;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698