Add ICU message format support
[chromium-blink-merge.git] / ui / display / chromeos / query_content_protection_task.h
blob863b286019f79b0d08e366e897a1ffa0bbe5a648
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"
13 namespace ui {
15 class DisplayLayoutManager;
16 class NativeDisplayDelegate;
18 class DISPLAY_EXPORT QueryContentProtectionTask {
19 public:
20 struct Response {
21 bool success = false;
22 uint32_t link_mask = 0;
23 uint32_t enabled = 0;
24 uint32_t unfulfilled = 0;
27 typedef base::Callback<void(Response)> ResponseCallback;
29 QueryContentProtectionTask(DisplayLayoutManager* layout_manager,
30 NativeDisplayDelegate* native_display_delegate,
31 int64_t display_id,
32 const ResponseCallback& callback);
33 ~QueryContentProtectionTask();
35 void Run();
37 private:
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.
46 int64_t display_id_;
48 // Called at the end of the query to signal completion.
49 ResponseCallback callback_;
51 Response response_;
53 // Tracks the number of NativeDisplayDelegate requests sent but not answered
54 // yet.
55 size_t pending_requests_;
57 base::WeakPtrFactory<QueryContentProtectionTask> weak_ptr_factory_;
59 DISALLOW_COPY_AND_ASSIGN(QueryContentProtectionTask);
62 } // namespace ui
64 #endif // UI_DISPLAY_CHROMEOS_QUERY_CONTENT_PROTECTION_TASK_H_