Index: chrome/browser/media/media_stream_capture_indicator.cc |
diff --git a/chrome/browser/media/media_stream_capture_indicator.cc b/chrome/browser/media/media_stream_capture_indicator.cc |
index b5a7bac618ed929a1e23c390362cd6bcf70d1c83..659171ed83d923caae9ccf1c3fbfb3b511bd31be 100644 |
--- a/chrome/browser/media/media_stream_capture_indicator.cc |
+++ b/chrome/browser/media/media_stream_capture_indicator.cc |
@@ -17,6 +17,7 @@ |
#include "chrome/browser/tab_contents/tab_util.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/content_browser_client.h" |
+#include "content/public/browser/invalidate_type.h" |
#include "content/public/browser/render_view_host.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_contents_delegate.h" |
@@ -199,11 +200,6 @@ void MediaStreamCaptureIndicator::DoDevicesOpenedOnUIThread( |
CreateStatusTray(); |
- // If we don't have a status icon or one could not be created successfully, |
- // then no need to continue. |
- if (!status_icon_) |
- return; |
- |
AddCaptureDeviceTab(render_process_id, render_view_id, devices); |
} |
@@ -212,8 +208,6 @@ void MediaStreamCaptureIndicator::DoDevicesClosedOnUIThread( |
int render_view_id, |
const content::MediaStreamDevices& devices) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- if (!status_icon_) |
- return; |
RemoveCaptureDeviceTab(render_process_id, render_view_id, devices); |
} |
@@ -415,6 +409,13 @@ void MediaStreamCaptureIndicator::AddCaptureDeviceTab( |
} |
} |
+ WebContents* web_contents = tab_util::GetWebContentsByID( |
+ render_process_id, render_view_id); |
+ web_contents->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TAB); |
+ |
+ if (!status_icon_) |
+ return; |
+ |
UpdateStatusTrayIconContextMenu(); |
ShowBalloon(render_process_id, render_view_id, audio, video); |
@@ -448,9 +449,22 @@ void MediaStreamCaptureIndicator::RemoveCaptureDeviceTab( |
tabs_.erase(iter); |
} |
+ if (!status_icon_) |
+ return; |
+ |
UpdateStatusTrayIconContextMenu(); |
} |
+bool MediaStreamCaptureIndicator::IsProcessCapturing(int render_process_id, |
+ int render_view_id) const { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ CaptureDeviceTabs::const_iterator iter = std::find_if( |
+ tabs_.begin(), tabs_.end(), TabEquals(render_process_id, render_view_id)); |
+ if (iter == tabs_.end()) |
+ return false; |
+ return (iter->audio_ref_count > 0 || iter->video_ref_count > 0); |
+} |
+ |
void MediaStreamCaptureIndicator::EnsureImageLoadingTracker() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
if (tracker_.get()) |