1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/renderer/media/crypto/key_systems_info.h"
7 #include "third_party/WebKit/public/platform/WebString.h"
9 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
11 // The following must be after widevine_cdm_version.h.
13 #if defined(DISABLE_WIDEVINE_CDM_CANPLAYTYPE)
14 #include "base/command_line.h"
15 #include "media/base/media_switches.h"
20 static const char kClearKeyKeySystem
[] = "webkit-org.w3.clearkey";
22 bool IsCanPlayTypeSuppressed(const std::string
& key_system
) {
23 #if defined(DISABLE_WIDEVINE_CDM_CANPLAYTYPE)
24 // See http://crbug.com/237627.
25 if (key_system
== kWidevineKeySystem
&&
26 !CommandLine::ForCurrentProcess()->HasSwitch(
27 switches::kOverrideEncryptedMediaCanPlayType
))
33 std::string
KeySystemNameForUMAInternal(const WebKit::WebString
& key_system
) {
34 if (key_system
== kClearKeyKeySystem
)
36 #if defined(WIDEVINE_CDM_AVAILABLE)
37 if (key_system
== kWidevineKeySystem
)
39 #endif // WIDEVINE_CDM_AVAILABLE
43 } // namespace content