Chromium Code Reviews| Index: chrome/browser/media/media_capture_devices_dispatcher.cc |
| diff --git a/chrome/browser/media/media_capture_devices_dispatcher.cc b/chrome/browser/media/media_capture_devices_dispatcher.cc |
| index 93d462b8bbe66567759879b3ea2e852421d03587..0564cff524e320d9c02a17b6a3c0ef4313e8379c 100644 |
| --- a/chrome/browser/media/media_capture_devices_dispatcher.cc |
| +++ b/chrome/browser/media/media_capture_devices_dispatcher.cc |
| @@ -89,60 +89,26 @@ bool IsMediaRequestWhitelistedForExtension( |
| extension->id() == "nnckehldicaciogcbchegobnafnjkcne"; |
| } |
| -// 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 IsOriginWhitelistedForScreenCapture(const GURL& origin) { |
| -#if defined(OFFICIAL_BUILD) |
| - if (// Google Hangouts. |
| - (origin.SchemeIs("https") && |
| - EndsWith(origin.spec(), ".talkgadget.google.com/", true)) || |
| - origin.spec() == "https://talkgadget.google.com/" || |
| - origin.spec() == "https://plus.google.com/" || |
| - origin.spec() == "chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/" || |
| - origin.spec() == "chrome-extension://fmfcbgogabcbclcofgocippekhfcmgfj/" || |
| - origin.spec() == "chrome-extension://hfaagokkkhdbgiakmmlclaapfelnkoah/" || |
| - origin.spec() == "chrome-extension://boadgeojelhgndaghljhdicfkmllpafd/" || |
| - origin.spec() == "chrome-extension://gfdkimpbcpahaombhbimeihdjnejgicl/") { |
| - return true; |
| - } |
| - // Check against hashed origins. |
| - // TODO(hshi): remove this when trusted tester becomes public. |
| - const std::string origin_hash = base::SHA1HashString(origin.spec()); |
| - DCHECK_EQ(origin_hash.length(), base::kSHA1Length); |
| - const std::string hexencoded_origin_hash = |
| - base::HexEncode(origin_hash.data(), origin_hash.length()); |
| +bool IsBuiltInExtension(const GURL& origin) { |
| return |
| - hexencoded_origin_hash == "3C2705BC432E7C51CA8553FDC5BEE873FF2468EE"; |
| -#else |
| - return false; |
| -#endif |
| + // Feedback Extension. |
| + origin.spec() == "chrome-extension://gfdkimpbcpahaombhbimeihdjnejgicl/"; |
| } |
| -#if defined(OS_CHROMEOS) |
| // Returns true of the security origin is associated with casting. |
| bool IsOriginForCasting(const GURL& origin) { |
|
mark a. foltz
2014/04/25 17:28:13
I would say IsOriginOfWhitelistedExtension
Sergey Ulanov
2014/04/25 21:02:27
I'd like to keep the current name (I'm not adding
|
| #if defined(OFFICIAL_BUILD) |
| // Whitelisted tab casting extensions. |
|
mark a. foltz
2014/04/25 17:28:13
Can you please add a numbered comment:
1. Dev
2.
Sergey Ulanov
2014/04/25 21:02:27
Done.
|
| - if (origin.spec() == "chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/" || |
| + return |
| + origin.spec() == "chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/" || |
|
mark a. foltz
2014/04/25 17:28:13
This ID is unused and can be removed.
Can you ple
Sergey Ulanov
2014/04/25 21:02:27
This one wasn't in the list before - do you really
|
| origin.spec() == "chrome-extension://fmfcbgogabcbclcofgocippekhfcmgfj/" || |
| origin.spec() == "chrome-extension://hfaagokkkhdbgiakmmlclaapfelnkoah/" || |
| - origin.spec() == "chrome-extension://boadgeojelhgndaghljhdicfkmllpafd/") { |
| - return true; |
| - } |
| - // Check against hashed origins. |
| - // TODO(hshi): remove this when trusted tester becomes public. |
| - const std::string origin_hash = base::SHA1HashString(origin.spec()); |
| - DCHECK_EQ(origin_hash.length(), base::kSHA1Length); |
| - const std::string hexencoded_origin_hash = |
| - base::HexEncode(origin_hash.data(), origin_hash.length()); |
| - return |
| - hexencoded_origin_hash == "3C2705BC432E7C51CA8553FDC5BEE873FF2468EE"; |
| + origin.spec() == "chrome-extension://boadgeojelhgndaghljhdicfkmllpafd/" || |
| + orogin.spec() == "chrome-extension://dliochdbjfkdbacpmhlcpmleaejidimm/"; |
|
mark a. foltz
2014/04/25 17:28:13
Typo in origin.
Sergey Ulanov
2014/04/25 21:02:27
Done.
|
| #else |
| return false; |
| #endif |
| } |
| -#endif |
| // Helper to get title of the calling application shown in the screen capture |
| // notification. |
| @@ -435,7 +401,8 @@ void MediaCaptureDevicesDispatcher::ProcessScreenCaptureAccessRequest( |
| const bool screen_capture_enabled = |
| CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kEnableUserMediaScreenCapturing) || |
| - IsOriginWhitelistedForScreenCapture(request.security_origin); |
| + IsOriginForCasting(request.security_origin) || |
| + IsBuiltInExtension(request.security_origin); |
| const bool origin_is_secure = |
| request.security_origin.SchemeIsSecure() || |