Index: content/browser/media/media_web_contents_observer.h |
diff --git a/content/browser/media/media_web_contents_observer.h b/content/browser/media/media_web_contents_observer.h |
index 0e3c980a42b1eaae62d17132aaca3a905fc10692..57543bcebbbd823e3c0eb22dcac11fdd67e4645f 100644 |
--- a/content/browser/media/media_web_contents_observer.h |
+++ b/content/browser/media/media_web_contents_observer.h |
@@ -11,6 +11,7 @@ |
#include <set> |
#include <vector> |
+#include "base/callback_forward.h" |
#include "base/macros.h" |
#include "base/memory/scoped_ptr.h" |
#include "content/common/content_export.h" |
@@ -47,6 +48,17 @@ class CONTENT_EXPORT MediaWebContentsObserver : public WebContentsObserver { |
return video_power_save_blocker_; |
} |
+ // Executes |on_focus_cb| once the given render frame has audio focus. Will |
+ // be run on the calling thread. Clients are responsible for invalidating |
+ // |on_focus_cb| if their lifetime changes or the callback is unnecessary. |
+ static void HasAudioFocus(int render_process_id, |
+ int render_frame_id, |
+ const base::Closure& on_focus_cb); |
+ |
+ protected: |
+ virtual void CheckFocus(int render_frame_id, |
+ const base::Closure& on_focus_cb); |
+ |
private: |
void OnMediaDestroyedNotification(RenderFrameHost* render_frame_host, |
int64_t player_cookie); |