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

Unified Diff: content/browser/media/session/pepper_player_delegate.h

Issue 2060933002: Let Flash join and be controlled by media session (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pepper_to_contents
Patch Set: addressed dcheng's comments Created 4 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/browser/media/session/pepper_player_delegate.h
diff --git a/content/browser/media/session/pepper_player_delegate.h b/content/browser/media/session/pepper_player_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..bf3a39bd83d2c098a40869fecc30d76c136c3145
--- /dev/null
+++ b/content/browser/media/session/pepper_player_delegate.h
@@ -0,0 +1,43 @@
+// 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.
+
+#ifndef CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYER_DELEGATE_H_
+#define CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYER_DELEGATE_H_
+
+#include "base/macros.h"
+#include "content/browser/media/session/media_session_observer.h"
+#include "content/browser/web_contents/web_contents_impl.h"
+
+namespace content {
+
+class PepperWebContentsObserver;
+
+class PepperPlayerDelegate : public MediaSessionObserver {
+ public:
+ // The Id can only be 0 for PepperPlayerDelegate. Declare the constant here so
+ // it can be used elsewhere.
+ static const int kPlayerId;
+
+ PepperPlayerDelegate(
+ WebContentsImpl* contents, int32_t pp_instance);
+ ~PepperPlayerDelegate() override;
+
+ // MediaSessionObserver implementation.
+ void OnSuspend(int player_id) override;
+ void OnResume(int player_id) override;
+ void OnSetVolumeMultiplier(int player_id,
+ double volume_multiplier) override;
+
+ private:
+ void SetVolume(int player_id, double volume);
+
+ WebContentsImpl* contents_;
+ int32_t pp_instance_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperPlayerDelegate);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYER_DELEGATE_H_
« no previous file with comments | « content/browser/media/session/pepper_playback_observer.cc ('k') | content/browser/media/session/pepper_player_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698