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

Unified Diff: chrome/browser/ui/screen_capture_infobar_delegate.cc

Issue 12596011: Whitelist Google Hangouts origins to access Screen Capture API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/screen_capture_infobar_delegate.cc
diff --git a/chrome/browser/ui/screen_capture_infobar_delegate.cc b/chrome/browser/ui/screen_capture_infobar_delegate.cc
index da44c941bc5343ecfb5c460434f892493428e18c..02dab1a1f0e1a5cbdf72fb46268207b06811625f 100644
--- a/chrome/browser/ui/screen_capture_infobar_delegate.cc
+++ b/chrome/browser/ui/screen_capture_infobar_delegate.cc
@@ -11,13 +11,26 @@
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+namespace {
+
+// This is a short-term solution to allow testing of the the Screen Capture API
+// with Google Hangouts in M27.
+// TODO(sergeyu): Remove this whitelist as soon as possible.
+bool IsWhitelistedOrigin(const GURL& origin) {
+ return origin.spec() == "https://staging.talkgadget.google.com/" ||
jschuh 2013/03/15 14:24:50 Would it be reasonable to put this in an OFFICIAL_
Sergey Ulanov 2013/03/15 22:30:57 Done.
+ origin.spec() == "https://plus.google.com/";
+}
+
+} // namespace
+
// static
void ScreenCaptureInfoBarDelegate::Create(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) {
bool screen_capture_enabled = CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableUserMediaScreenCapturing);
+ switches::kEnableUserMediaScreenCapturing) ||
jschuh 2013/03/15 14:24:50 I thought we were going to require both the switch
+ IsWhitelistedOrigin(request.security_origin);
// Deny request automatically in the following cases:
// 1. Screen capturing is not enabled via command line switch.
// 2. Audio capture was requested (it's not supported yet).
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698