ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chromecast / browser / media / cast_browser_cdm_factory.cc
blob2dbb544f86a62a83cbb8beda4a1c5feb81d8ad43
1 // Copyright 2014 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 "chromecast/browser/media/cast_browser_cdm_factory.h"
7 #include "chromecast/media/cdm/browser_cdm_cast.h"
9 namespace chromecast {
10 namespace media {
12 scoped_ptr< ::media::BrowserCdm> CastBrowserCdmFactory::CreateBrowserCdm(
13 const std::string& key_system_name,
14 const ::media::SessionMessageCB& session_message_cb,
15 const ::media::SessionClosedCB& session_closed_cb,
16 const ::media::SessionErrorCB& session_error_cb,
17 const ::media::SessionKeysChangeCB& session_keys_change_cb,
18 const ::media::SessionExpirationUpdateCB& session_expiration_update_cb) {
19 CastKeySystem key_system(GetKeySystemByName(key_system_name));
21 scoped_ptr<chromecast::media::BrowserCdmCast> browser_cdm;
22 if (key_system == chromecast::media::KEY_SYSTEM_CLEAR_KEY) {
23 // TODO(gunsch): handle ClearKey decryption. See crbug.com/441957
24 } else {
25 browser_cdm = CreatePlatformBrowserCdm(key_system);
28 if (browser_cdm) {
29 browser_cdm->SetCallbacks(session_message_cb,
30 session_closed_cb,
31 session_error_cb,
32 session_keys_change_cb,
33 session_expiration_update_cb);
34 return browser_cdm.Pass();
37 LOG(INFO) << "No matching key system found.";
38 return scoped_ptr< ::media::BrowserCdm>();
41 } // namespace media
42 } // namespace chromecast