Add a string for translation.
[chromium-blink-merge.git] / android_webview / renderer / aw_key_systems.cc
blobb276c88f5a4596fb222f8936d769ae355dfd79c3
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 "android_webview/renderer/aw_key_systems.h"
7 #include <string>
9 #include "base/command_line.h"
10 #include "base/logging.h"
11 #include "content/public/common/eme_codec.h"
12 #include "third_party/widevine/cdm/widevine_cdm_common.h"
14 using content::KeySystemInfo;
16 namespace {
18 // Return |name|'s parent key system.
19 std::string GetDirectParentName(const std::string& name) {
20 int last_period = name.find_last_of('.');
21 DCHECK_GT(last_period, 0);
22 return name.substr(0, last_period);
25 void AddWidevineWithCodecs(const std::string& key_system_name,
26 bool add_parent_name,
27 std::vector<KeySystemInfo>* concrete_key_systems) {
28 KeySystemInfo info(key_system_name);
30 if (add_parent_name)
31 info.parent_key_system = GetDirectParentName(key_system_name);
33 info.supported_codecs = content::EME_CODEC_MP4_ALL;
35 concrete_key_systems->push_back(info);
38 } // namespace
40 namespace android_webview {
42 void AwAddKeySystems(
43 std::vector<KeySystemInfo>* key_systems_info) {
44 AddWidevineWithCodecs(kWidevineKeySystem, true, key_systems_info);
47 } // namespace android_webview