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

Unified Diff: chrome/browser/media/media_internals.cc

Issue 10835025: Plumb render view ID to media observer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months 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 | « chrome/browser/media/media_internals.h ('k') | content/browser/renderer_host/media/audio_renderer_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/media_internals.cc
diff --git a/chrome/browser/media/media_internals.cc b/chrome/browser/media/media_internals.cc
index cca5c7650b2cfa132099abedff26a1649a81176b..2fb9faf1a4d1b70b07587f41610886ebc724db3b 100644
--- a/chrome/browser/media/media_internals.cc
+++ b/chrome/browser/media/media_internals.cc
@@ -9,11 +9,15 @@
#include "base/stringprintf.h"
#include "chrome/browser/media/media_internals_observer.h"
#include "chrome/browser/media/media_stream_capture_indicator.h"
+#include "chrome/browser/tab_contents/tab_util.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "media/base/media_log.h"
#include "media/base/media_log_event.h"
+#include "base/utf_string_conversions.h"
+
using content::BrowserThread;
MediaInternals* MediaInternals::GetInstance() {
@@ -37,10 +41,29 @@ void MediaInternals::OnSetAudioStreamPlaying(
}
void MediaInternals::OnSetAudioStreamStatus(
- void* host, int stream_id, const std::string& status) {
+ void* host,
+ int stream_id,
+ int render_process_id,
+ int render_view_id,
+ const std::string& status) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
UpdateAudioStream(host, stream_id,
"status", Value::CreateStringValue(status));
+
+ content::WebContents* web_content =
+ tab_util::GetWebContentsByID(render_process_id, render_view_id);
+ if (web_content) {
+ string16 tab_title = web_content->GetTitle();
+ fprintf(stderr, "%s (%d, %d) - title: '%s'\n",
+ __PRETTY_FUNCTION__, render_process_id, render_view_id,
+ UTF16ToUTF8(tab_title).c_str());
+ UpdateAudioStream(host, stream_id,
+ "tabtitle",
+ Value::CreateStringValue(tab_title));
+ } else {
+ fprintf(stderr, "%s (%d, %d) - NULL web_contents\n",
+ __PRETTY_FUNCTION__, render_process_id, render_view_id);
+ }
}
void MediaInternals::OnSetAudioStreamVolume(
« no previous file with comments | « chrome/browser/media/media_internals.h ('k') | content/browser/renderer_host/media/audio_renderer_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698