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

Unified Diff: content/public/browser/web_contents_observer.h

Issue 1478643002: Refactor media out of WebContentsImpl to MediaWebContentsObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix namespace for cast. Created 5 years 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
« no previous file with comments | « content/content_browser.gypi ('k') | content/test/web_contents_observer_sanity_checker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/web_contents_observer.h
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
index 92bf9773edcdeaeb28929fe6197d77393979fb8c..f77f9113c8cb5e1cd3cd32dafdff03fda89ecec6 100644
--- a/content/public/browser/web_contents_observer.h
+++ b/content/public/browser/web_contents_observer.h
@@ -424,11 +424,14 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener,
// Invoked when theme color is changed to |theme_color|.
virtual void DidChangeThemeColor(SkColor theme_color) {}
- // Invoked when media is playing.
- virtual void MediaStartedPlaying() {}
-
- // Invoked when media is paused.
- virtual void MediaPaused() {}
+ // Invoked when media is playing or paused. |id| is unique per player and per
+ // RenderFrameHost. There may be multiple players within a RenderFrameHost
+ // and subsequently within a WebContents. MediaStartedPlaying() will always
+ // be followed by MediaStoppedPlaying() after player teardown. Observers must
+ // release all stored copies of |id| when MediaStoppedPlaying() is received.
+ using MediaPlayerId = std::pair<RenderFrameHost*, int64_t>;
+ virtual void MediaStartedPlaying(const MediaPlayerId& id) {}
+ virtual void MediaStoppedPlaying(const MediaPlayerId& id) {}
// Invoked when media session has changed its state.
virtual void MediaSessionStateChanged(bool is_controllable,
« no previous file with comments | « content/content_browser.gypi ('k') | content/test/web_contents_observer_sanity_checker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698