Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 462 // Invoked when media is playing or paused. |id| is unique per player and per | 462 // Invoked when media is playing or paused. |id| is unique per player and per |
| 463 // RenderFrameHost. There may be multiple players within a RenderFrameHost | 463 // RenderFrameHost. There may be multiple players within a RenderFrameHost |
| 464 // and subsequently within a WebContents. MediaStartedPlaying() will always | 464 // and subsequently within a WebContents. MediaStartedPlaying() will always |
| 465 // be followed by MediaStoppedPlaying() after player teardown. Observers must | 465 // be followed by MediaStoppedPlaying() after player teardown. Observers must |
| 466 // release all stored copies of |id| when MediaStoppedPlaying() is received. | 466 // release all stored copies of |id| when MediaStoppedPlaying() is received. |
| 467 using MediaPlayerId = std::pair<RenderFrameHost*, int>; | 467 using MediaPlayerId = std::pair<RenderFrameHost*, int>; |
| 468 virtual void MediaStartedPlaying(const MediaPlayerId& id) {} | 468 virtual void MediaStartedPlaying(const MediaPlayerId& id) {} |
| 469 virtual void MediaStoppedPlaying(const MediaPlayerId& id) {} | 469 virtual void MediaStoppedPlaying(const MediaPlayerId& id) {} |
| 470 | 470 |
| 471 // Invoked when media session has changed its state. | 471 // Invoked when media session has changed its state. |
| 472 virtual void MediaSessionStateChanged( | 472 virtual void MediaSessionStateChanged(bool is_controllable, |
| 473 bool is_controllable, | 473 bool is_suspended) {} |
| 474 bool is_suspended, | 474 |
| 475 // Invoked when media session metadata has changed. | |
|
clamy
2016/10/12 12:25:04
Could you add a comment explaining that |metadata|
Zhiqiang Zhang (Slow)
2016/10/12 12:41:16
Done.
| |
| 476 virtual void MediaSessionMetadataChanged( | |
| 475 const base::Optional<MediaMetadata>& metadata) {} | 477 const base::Optional<MediaMetadata>& metadata) {} |
| 476 | 478 |
| 477 // Invoked when the renderer process changes the page scale factor. | 479 // Invoked when the renderer process changes the page scale factor. |
| 478 virtual void OnPageScaleFactorChanged(float page_scale_factor) {} | 480 virtual void OnPageScaleFactorChanged(float page_scale_factor) {} |
| 479 | 481 |
| 480 // Invoked if an IPC message is coming from a specific RenderFrameHost. | 482 // Invoked if an IPC message is coming from a specific RenderFrameHost. |
| 481 virtual bool OnMessageReceived(const IPC::Message& message, | 483 virtual bool OnMessageReceived(const IPC::Message& message, |
| 482 RenderFrameHost* render_frame_host); | 484 RenderFrameHost* render_frame_host); |
| 483 | 485 |
| 484 // Notification that |contents| has gained focus. | 486 // Notification that |contents| has gained focus. |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 514 void ResetWebContents(); | 516 void ResetWebContents(); |
| 515 | 517 |
| 516 WebContentsImpl* web_contents_; | 518 WebContentsImpl* web_contents_; |
| 517 | 519 |
| 518 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); | 520 DISALLOW_COPY_AND_ASSIGN(WebContentsObserver); |
| 519 }; | 521 }; |
| 520 | 522 |
| 521 } // namespace content | 523 } // namespace content |
| 522 | 524 |
| 523 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ | 525 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |