| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYER_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYER_DELEGATE_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYER_DELEGATE_H_ | 6 #define CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "content/browser/media/session/media_session_player_observer.h" | 11 #include "content/browser/media/session/media_session_player_observer.h" |
| 10 #include "content/browser/web_contents/web_contents_impl.h" | |
| 11 | 12 |
| 12 namespace content { | 13 namespace content { |
| 13 | 14 |
| 15 class RenderFrameHost; |
| 16 |
| 14 class PepperPlayerDelegate : public MediaSessionPlayerObserver { | 17 class PepperPlayerDelegate : public MediaSessionPlayerObserver { |
| 15 public: | 18 public: |
| 16 // The Id can only be 0 for PepperPlayerDelegate. Declare the constant here so | 19 // The Id can only be 0 for PepperPlayerDelegate. Declare the constant here so |
| 17 // it can be used elsewhere. | 20 // it can be used elsewhere. |
| 18 static const int kPlayerId; | 21 static const int kPlayerId; |
| 19 | 22 |
| 20 PepperPlayerDelegate( | 23 PepperPlayerDelegate( |
| 21 WebContentsImpl* contents, int32_t pp_instance); | 24 RenderFrameHost* render_frame_host, int32_t pp_instance); |
| 22 ~PepperPlayerDelegate() override; | 25 ~PepperPlayerDelegate() override; |
| 23 | 26 |
| 24 // MediaSessionPlayerObserver implementation. | 27 // MediaSessionPlayerObserver implementation. |
| 25 void OnSuspend(int player_id) override; | 28 void OnSuspend(int player_id) override; |
| 26 void OnResume(int player_id) override; | 29 void OnResume(int player_id) override; |
| 27 void OnSetVolumeMultiplier(int player_id, | 30 void OnSetVolumeMultiplier(int player_id, |
| 28 double volume_multiplier) override; | 31 double volume_multiplier) override; |
| 29 RenderFrameHost* GetRenderFrameHost() const override; | 32 RenderFrameHost* GetRenderFrameHost() const override; |
| 30 | 33 |
| 31 private: | 34 private: |
| 32 void SetVolume(int player_id, double volume); | 35 void SetVolume(int player_id, double volume); |
| 33 | 36 |
| 34 WebContentsImpl* contents_; | 37 RenderFrameHost* render_frame_host_; |
| 35 int32_t pp_instance_; | 38 int32_t pp_instance_; |
| 36 | 39 |
| 37 DISALLOW_COPY_AND_ASSIGN(PepperPlayerDelegate); | 40 DISALLOW_COPY_AND_ASSIGN(PepperPlayerDelegate); |
| 38 }; | 41 }; |
| 39 | 42 |
| 40 } // namespace content | 43 } // namespace content |
| 41 | 44 |
| 42 #endif // CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYER_DELEGATE_H_ | 45 #endif // CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYER_DELEGATE_H_ |
| OLD | NEW |