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. 4 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_PROXY_MEDIA_KEYS_H_ 6 #define CONTENT_RENDERER_MEDIA_ANDROID_PROXY_MEDIA_KEYS_H_ 7 8 #include "base/basictypes.h" 9 #include "media/base/media_keys.h" 10 11 namespace content { 12 13 class WebMediaPlayerProxyAndroid; 14 15 // MediaKeys wrapper of the WebMediaPlayerProxyAndroid. 16 // TODO(xhwang): Remove |player_id| from WebMediaPlayerProxyAndroid, make 17 // WebMediaPlayerProxyAndroid a subclass of media::MediaKeys, then remove this 18 // class! 19 class ProxyMediaKeys : public media::MediaKeys { 20 public: 21 ProxyMediaKeys(WebMediaPlayerProxyAndroid* proxy, int media_keys_id); 22 23 void InitializeCDM(const std::string& key_system); 24 25 // MediaKeys implementation. 26 virtual bool GenerateKeyRequest(const std::string& type, 27 const uint8* init_data, 28 int init_data_length) OVERRIDE; 29 virtual void AddKey(const uint8* key, int key_length, 30 const uint8* init_data, int init_data_length, 31 const std::string& session_id) OVERRIDE; 32 virtual void CancelKeyRequest(const std::string& session_id) OVERRIDE; 33 34 private: 35 WebMediaPlayerProxyAndroid* proxy_; 36 int media_keys_id_; 37 38 DISALLOW_COPY_AND_ASSIGN (ProxyMediaKeys); 39 }; 40 41 } // namespace content 42 43 #endif // CONTENT_RENDERER_MEDIA_ANDROID_PROXY_MEDIA_KEYS_H_ 44