[M120 Migration][MM][CAPI] Fix the logic for media using capi player.
[platform/framework/web/chromium-efl.git] / media / mojo / services / media_foundation_preferences.h
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.
4
5 #ifndef MEDIA_MOJO_SERVICES_MEDIA_FOUNDATION_PREFERENCES_H_
6 #define MEDIA_MOJO_SERVICES_MEDIA_FOUNDATION_PREFERENCES_H_
7
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"
12 #include "url/gurl.h"
13
14 class MEDIA_MOJO_EXPORT MediaFoundationPreferencesImpl final
15     : public media::mojom::MediaFoundationPreferences {
16  public:
17   using IsHardwareSecureDecryptionAllowedCB =
18       base::RepeatingCallback<bool(const GURL&)>;
19
20   MediaFoundationPreferencesImpl(const GURL& site,
21                                  IsHardwareSecureDecryptionAllowedCB cb);
22
23   MediaFoundationPreferencesImpl(const MediaFoundationPreferencesImpl&) =
24       delete;
25   MediaFoundationPreferencesImpl& operator=(
26       const MediaFoundationPreferencesImpl&) = delete;
27
28   ~MediaFoundationPreferencesImpl() override;
29
30   static void Create(
31       const GURL& site,
32       IsHardwareSecureDecryptionAllowedCB cb,
33       mojo::PendingReceiver<media::mojom::MediaFoundationPreferences> receiver);
34
35   void IsHardwareSecureDecryptionAllowed(
36       IsHardwareSecureDecryptionAllowedCallback cb) override;
37
38  private:
39   GURL site_;
40   IsHardwareSecureDecryptionAllowedCB is_hardware_secure_decryption_allowed_cb_;
41 };
42
43 #endif  // MEDIA_MOJO_SERVICES_MEDIA_FOUNDATION_PREFERENCES_H_