Chromium Code Reviews| Index: chrome/browser/media/protected_media_identifier_permission_context.cc |
| diff --git a/chrome/browser/media/protected_media_identifier_permission_context.cc b/chrome/browser/media/protected_media_identifier_permission_context.cc |
| index 50c2dc51ec53a1f4269eff81c038c44fc6eb40bc..ae36ffd4a1a10340eef2535fe1d956b3d5643fcd 100644 |
| --- a/chrome/browser/media/protected_media_identifier_permission_context.cc |
| +++ b/chrome/browser/media/protected_media_identifier_permission_context.cc |
| @@ -15,7 +15,9 @@ |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/render_frame_host.h" |
| #include "content/public/browser/web_contents.h" |
| -#if defined(OS_CHROMEOS) |
| +#if defined(OS_ANDROID) |
| +#include "media/base/media_switches.h" |
| +#elif defined(OS_CHROMEOS) |
| #include <utility> |
| #include "chrome/browser/chromeos/attestation/platform_verification_dialog.h" |
| @@ -25,7 +27,7 @@ |
| #include "components/pref_registry/pref_registry_syncable.h" |
| #include "components/user_prefs/user_prefs.h" |
| #include "ui/views/widget/widget.h" |
| -#elif !defined(OS_ANDROID) |
| +#else |
| #error This file currently only supports Chrome OS and Android. |
| #endif |
| @@ -101,6 +103,21 @@ ProtectedMediaIdentifierPermissionContext::GetPermissionStatusInternal( |
| content_setting == CONTENT_SETTING_BLOCK || |
| content_setting == CONTENT_SETTING_ASK); |
| + #if defined(OS_ANDROID) |
|
Joey Parrish
2017/04/17 19:45:18
I am of the opinion that this could be useful in o
Vaage
2017/04/19 16:55:47
Done.
|
| + const bool isLocal = requesting_origin.host() == "localhost" && |
| + embedding_origin.host() == "localhost"; |
|
Joey Parrish
2017/04/17 19:45:18
I found this, for context: https://groups.google.c
Vaage
2017/04/19 16:55:47
Done.
|
| + |
| + // For testing of protected content, always allow content from localhost |
| + // if the switch has been set. |
| + const bool allowLocalContent = |
| + base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kDisableInfobarForProtectedMediaIdentifierForLocalhost); |
| + |
| + if (allowLocalContent && isLocal && content_setting == CONTENT_SETTING_ASK) { |
| + content_setting = CONTENT_SETTING_ALLOW; |
| + } |
| + #endif |
| + |
| return content_setting; |
| } |