| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MEDIA_WEB_CONTENTS_OBSERVER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_MEDIA_WEB_CONTENTS_OBSERVER_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_MEDIA_WEB_CONTENTS_OBSERVER_H_ | 6 #define CONTENT_BROWSER_MEDIA_MEDIA_WEB_CONTENTS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/containers/scoped_ptr_hash_map.h" | 9 #include "base/containers/scoped_ptr_hash_map.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class BrowserCdmManager; | 15 class BrowserCdmManager; |
| 16 class BrowserMediaPlayerManager; | 16 class BrowserMediaPlayerManager; |
| 17 class RenderViewHost; | 17 class RenderViewHost; |
| 18 | 18 |
| 19 // This class manages all RenderFrame based media related managers at the | 19 // This class manages all RenderFrame based media related managers at the |
| 20 // browser side. It receives IPC messages from media RenderFrameObservers and | 20 // browser side. It receives IPC messages from media RenderFrameObservers and |
| 21 // forwards them to the corresponding managers. The managers are responsible | 21 // forwards them to the corresponding managers. The managers are responsible |
| 22 // for sending IPCs back to the RenderFrameObservers at the render side. | 22 // for sending IPCs back to the RenderFrameObservers at the render side. |
| 23 class CONTENT_EXPORT MediaWebContentsObserver : public WebContentsObserver { | 23 class CONTENT_EXPORT MediaWebContentsObserver : public WebContentsObserver { |
| 24 public: | 24 public: |
| 25 explicit MediaWebContentsObserver(RenderViewHost* render_view_host); | 25 explicit MediaWebContentsObserver(RenderViewHost* render_view_host); |
| 26 virtual ~MediaWebContentsObserver(); | 26 virtual ~MediaWebContentsObserver(); |
| 27 | 27 |
| 28 // WebContentsObserver implementations. | 28 // WebContentsObserver implementations. |
| 29 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) OVERRIDE; | 29 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; |
| 30 | 30 |
| 31 #if defined(OS_ANDROID) | 31 #if defined(OS_ANDROID) |
| 32 virtual bool OnMessageReceived(const IPC::Message& message, | 32 virtual bool OnMessageReceived(const IPC::Message& message, |
| 33 RenderFrameHost* render_frame_host) OVERRIDE; | 33 RenderFrameHost* render_frame_host) override; |
| 34 | 34 |
| 35 // Helper functions to handle media player IPC messages. Returns whether the | 35 // Helper functions to handle media player IPC messages. Returns whether the |
| 36 // |message| is handled in the function. | 36 // |message| is handled in the function. |
| 37 bool OnMediaPlayerMessageReceived(const IPC::Message& message, | 37 bool OnMediaPlayerMessageReceived(const IPC::Message& message, |
| 38 RenderFrameHost* render_frame_host); | 38 RenderFrameHost* render_frame_host); |
| 39 bool OnMediaPlayerSetCdmMessageReceived(const IPC::Message& message, | 39 bool OnMediaPlayerSetCdmMessageReceived(const IPC::Message& message, |
| 40 RenderFrameHost* render_frame_host); | 40 RenderFrameHost* render_frame_host); |
| 41 | 41 |
| 42 // Gets the media player manager associated with |render_frame_host|. Creates | 42 // Gets the media player manager associated with |render_frame_host|. Creates |
| 43 // a new one if it doesn't exist. The caller doesn't own the returned pointer. | 43 // a new one if it doesn't exist. The caller doesn't own the returned pointer. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 57 MediaPlayerManagerMap media_player_managers_; | 57 MediaPlayerManagerMap media_player_managers_; |
| 58 #endif // defined(OS_ANDROID) | 58 #endif // defined(OS_ANDROID) |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 DISALLOW_COPY_AND_ASSIGN(MediaWebContentsObserver); | 61 DISALLOW_COPY_AND_ASSIGN(MediaWebContentsObserver); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace content | 64 } // namespace content |
| 65 | 65 |
| 66 #endif // CONTENT_BROWSER_MEDIA_MEDIA_WEB_CONTENTS_OBSERVER_H_ | 66 #endif // CONTENT_BROWSER_MEDIA_MEDIA_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |