1 // Copyright 2015 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 #ifndef UI_DISPLAY_CHROMEOS_QUERY_CONTENT_PROTECTION_TASK_H_
6 #define UI_DISPLAY_CHROMEOS_QUERY_CONTENT_PROTECTION_TASK_H_
8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h"
10 #include "ui/display/display_export.h"
11 #include "ui/display/types/display_constants.h"
15 class DisplayLayoutManager
;
16 class NativeDisplayDelegate
;
18 class DISPLAY_EXPORT QueryContentProtectionTask
{
22 uint32_t link_mask
= 0;
24 uint32_t unfulfilled
= 0;
27 typedef base::Callback
<void(Response
)> ResponseCallback
;
29 QueryContentProtectionTask(DisplayLayoutManager
* layout_manager
,
30 NativeDisplayDelegate
* native_display_delegate
,
32 const ResponseCallback
& callback
);
33 ~QueryContentProtectionTask();
38 // Callback for NativeDisplayDelegate::GetHDCPState()
39 void OnHDCPStateUpdate(bool success
, HDCPState state
);
41 DisplayLayoutManager
* layout_manager_
; // Not owned.
43 NativeDisplayDelegate
* native_display_delegate_
; // Not owned.
45 // Display ID for the query.
48 // Called at the end of the query to signal completion.
49 ResponseCallback callback_
;
53 // Tracks the number of NativeDisplayDelegate requests sent but not answered
55 size_t pending_requests_
;
57 base::WeakPtrFactory
<QueryContentProtectionTask
> weak_ptr_factory_
;
59 DISALLOW_COPY_AND_ASSIGN(QueryContentProtectionTask
);
64 #endif // UI_DISPLAY_CHROMEOS_QUERY_CONTENT_PROTECTION_TASK_H_