1 // Copyright 2023 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_MOJO_SERVICES_MEDIA_FOUNDATION_PREFERENCES_H_
6 #define MEDIA_MOJO_SERVICES_MEDIA_FOUNDATION_PREFERENCES_H_
8 #include "base/functional/callback_forward.h"
9 #include "media/mojo/mojom/media_foundation_preferences.mojom.h"
10 #include "media/mojo/services/media_mojo_export.h"
11 #include "mojo/public/cpp/bindings/receiver.h"
14 class MEDIA_MOJO_EXPORT MediaFoundationPreferencesImpl final
15 : public media::mojom::MediaFoundationPreferences {
17 using IsHardwareSecureDecryptionAllowedCB =
18 base::RepeatingCallback<bool(const GURL&)>;
20 MediaFoundationPreferencesImpl(const GURL& site,
21 IsHardwareSecureDecryptionAllowedCB cb);
23 MediaFoundationPreferencesImpl(const MediaFoundationPreferencesImpl&) =
25 MediaFoundationPreferencesImpl& operator=(
26 const MediaFoundationPreferencesImpl&) = delete;
28 ~MediaFoundationPreferencesImpl() override;
32 IsHardwareSecureDecryptionAllowedCB cb,
33 mojo::PendingReceiver<media::mojom::MediaFoundationPreferences> receiver);
35 void IsHardwareSecureDecryptionAllowed(
36 IsHardwareSecureDecryptionAllowedCallback cb) override;
40 IsHardwareSecureDecryptionAllowedCB is_hardware_secure_decryption_allowed_cb_;
43 #endif // MEDIA_MOJO_SERVICES_MEDIA_FOUNDATION_PREFERENCES_H_