| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MEDIA_SESSION_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ | 6 #define CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // WebContents can only have one audio focus at a time, it will be Content in | 60 // WebContents can only have one audio focus at a time, it will be Content in |
| 61 // case of Transient and Content audio focus are both requested. | 61 // case of Transient and Content audio focus are both requested. |
| 62 // TODO(thakis,mlamouri): MediaSessionImpl isn't CONTENT_EXPORT'd because it | 62 // TODO(thakis,mlamouri): MediaSessionImpl isn't CONTENT_EXPORT'd because it |
| 63 // creates complicated build issues with WebContentsUserData being a | 63 // creates complicated build issues with WebContentsUserData being a |
| 64 // non-exported template, see https://crbug.com/589840. As a result, the class | 64 // non-exported template, see https://crbug.com/589840. As a result, the class |
| 65 // uses CONTENT_EXPORT for methods that are being used from tests. | 65 // uses CONTENT_EXPORT for methods that are being used from tests. |
| 66 // CONTENT_EXPORT should be moved back to the class when the Windows build will | 66 // CONTENT_EXPORT should be moved back to the class when the Windows build will |
| 67 // work with it. | 67 // work with it. |
| 68 class MediaSessionImpl : public MediaSession, | 68 class MediaSessionImpl : public MediaSession, |
| 69 public WebContentsObserver, | 69 public WebContentsObserver, |
| 70 protected WebContentsUserData<MediaSessionImpl> { | 70 public WebContentsUserData<MediaSessionImpl> { |
| 71 public: | 71 public: |
| 72 enum class State { ACTIVE, SUSPENDED, INACTIVE }; | 72 enum class State { ACTIVE, SUSPENDED, INACTIVE }; |
| 73 | 73 |
| 74 // Returns the MediaSessionImpl associated to this WebContents. Creates one if | 74 // Returns the MediaSessionImpl associated to this WebContents. Creates one if |
| 75 // none is currently available. | 75 // none is currently available. |
| 76 CONTENT_EXPORT static MediaSessionImpl* Get(WebContents* web_contents); | 76 CONTENT_EXPORT static MediaSessionImpl* Get(WebContents* web_contents); |
| 77 | 77 |
| 78 ~MediaSessionImpl() override; | 78 ~MediaSessionImpl() override; |
| 79 | 79 |
| 80 #if defined(OS_ANDROID) | 80 #if defined(OS_ANDROID) |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 ServicesMap services_; | 313 ServicesMap services_; |
| 314 // The currently routed service (non-owned pointer). | 314 // The currently routed service (non-owned pointer). |
| 315 MediaSessionServiceImpl* routed_service_; | 315 MediaSessionServiceImpl* routed_service_; |
| 316 | 316 |
| 317 DISALLOW_COPY_AND_ASSIGN(MediaSessionImpl); | 317 DISALLOW_COPY_AND_ASSIGN(MediaSessionImpl); |
| 318 }; | 318 }; |
| 319 | 319 |
| 320 } // namespace content | 320 } // namespace content |
| 321 | 321 |
| 322 #endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ | 322 #endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_IMPL_H_ |
| OLD | NEW |