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

Unified Diff: content/public/browser/android/media_controls_delegate.h

Issue 1159113006: [Android] A prototype of the interactive media notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests and Min's nits Created 5 years, 6 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: content/public/browser/android/media_controls_delegate.h
diff --git a/content/public/browser/android/media_controls_delegate.h b/content/public/browser/android/media_controls_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..bc8c2136da59cb2ee03b47b9102282b0d234a508
--- /dev/null
+++ b/content/public/browser/android/media_controls_delegate.h
@@ -0,0 +1,42 @@
+// Copyright 2015 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.
+
+#ifndef CONTENT_PUBLIC_BROWSER_ANDROID_MEDIA_CONTROLS_DELEGATE_H_
+#define CONTENT_PUBLIC_BROWSER_ANDROID_MEDIA_CONTROLS_DELEGATE_H_
+
+#include "base/macros.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+// Provides the necessary information to media controls and gets notified about
+// the media controls events.
+class CONTENT_EXPORT MediaControlsDelegate {
+ public:
+ // Called when the user interacts with the Pause control (e.g. taps on a
+ // button).
+ virtual void OnControlsPause() = 0;
+
+ // Called when the user interacts with the Play control (e.g. taps on a
+ // button).
+ virtual void OnControlsResume() = 0;
+
+ // Indicates if the media controls are allowed to affect the state of the
+ // delegate. If returns false, controls should be hidden/disabled.
+ virtual bool IsControllable() = 0;
+
+ // Indicates if the controls should be in the paused state or not.
+ virtual bool IsPaused() = 0;
+
+ protected:
+ MediaControlsDelegate() = default;
+ virtual ~MediaControlsDelegate() = default;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MediaControlsDelegate);
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_ANDROID_MEDIA_CONTROLS_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698