Chromium Code Reviews| 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). |