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

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

Issue 186133005: Adds extension name to the screencast notification bar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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
Index: chrome/browser/media/desktop_streams_registry.cc
diff --git a/chrome/browser/media/desktop_streams_registry.cc b/chrome/browser/media/desktop_streams_registry.cc
index 05c2ba007cebdc65eaa128f6dfdfb43293b9ca89..f2e2607d63c9b40febd89be6e5dba7baf3bd393f 100644
--- a/chrome/browser/media/desktop_streams_registry.cc
+++ b/chrome/browser/media/desktop_streams_registry.cc
@@ -34,7 +34,8 @@ std::string DesktopStreamsRegistry::RegisterStream(
int render_process_id,
int render_view_id,
const GURL& origin,
- const content::DesktopMediaID& source) {
+ const content::DesktopMediaID& source,
+ const std::string& extension_name) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
std::string id = GenerateRandomStreamId();
@@ -43,6 +44,7 @@ std::string DesktopStreamsRegistry::RegisterStream(
stream.render_view_id = render_view_id;
stream.origin = origin;
stream.source = source;
+ stream.extension_name = extension_name;
content::BrowserThread::PostDelayedTask(
content::BrowserThread::UI, FROM_HERE,
@@ -57,7 +59,8 @@ content::DesktopMediaID DesktopStreamsRegistry::RequestMediaForStreamId(
const std::string& id,
int render_process_id,
int render_view_id,
- const GURL& origin) {
+ const GURL& origin,
+ std::string* extension_name) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
StreamsMap::iterator it = approved_streams_.find(id);
@@ -72,6 +75,7 @@ content::DesktopMediaID DesktopStreamsRegistry::RequestMediaForStreamId(
}
content::DesktopMediaID result = it->second.source;
+ *extension_name = it->second.extension_name;
approved_streams_.erase(it);
return result;
}
@@ -80,3 +84,6 @@ void DesktopStreamsRegistry::CleanupStream(const std::string& id) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
approved_streams_.erase(id);
}
+
+DesktopStreamsRegistry::ApprovedDesktopMediaStream::ApprovedDesktopMediaStream()
+ : render_process_id(-1), render_view_id(-1) {}
« no previous file with comments | « chrome/browser/media/desktop_streams_registry.h ('k') | chrome/browser/media/media_capture_devices_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698