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. 4 5#ifndef MediaKeysController_h 6#define MediaKeysController_h 7 8#include "core/page/Page.h" 9#include "wtf/PassOwnPtr.h" 10 11namespace blink { 12 13class ExecutionContext; 14class MediaKeysClient; 15class WebContentDecryptionModule; 16 17class MediaKeysController FINAL : public NoBaseWillBeGarbageCollected<MediaKeysController>, public WillBeHeapSupplement<Page> { 18 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeysController); 19public: 20 PassOwnPtr<WebContentDecryptionModule> createContentDecryptionModule(ExecutionContext*, const String& keySystem); 21 22 static void provideMediaKeysTo(Page&, MediaKeysClient*); 23 static MediaKeysController* from(Page* page) { return static_cast<MediaKeysController*>(WillBeHeapSupplement<Page>::from(page, supplementName())); } 24 25 virtual void trace(Visitor* visitor) OVERRIDE { WillBeHeapSupplement<Page>::trace(visitor); } 26 27private: 28 explicit MediaKeysController(MediaKeysClient*); 29 static const char* supplementName(); 30 MediaKeysClient* m_client; 31}; 32 33} // namespace blink 34 35#endif // MediaKeysController_h 36 37