Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: ui/display/manager/chromeos/apply_content_protection_task.cc

Issue 2540313002: Split //ui/display and create //ui/display/manager. (Closed)
Patch Set: Cleanup export header. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/display/chromeos/apply_content_protection_task.h" 5 #include "ui/display/manager/chromeos/apply_content_protection_task.h"
6 6
7 #include "ui/display/chromeos/display_layout_manager.h" 7 #include "ui/display/manager/chromeos/display_layout_manager.h"
8 #include "ui/display/types/display_snapshot.h" 8 #include "ui/display/types/display_snapshot.h"
9 #include "ui/display/types/native_display_delegate.h" 9 #include "ui/display/types/native_display_delegate.h"
10 10
11 namespace ui { 11 namespace ui {
12 12
13 namespace { 13 namespace {
14 14
15 bool GetHDCPCapableDisplays( 15 bool GetHDCPCapableDisplays(
16 const DisplayLayoutManager& layout_manager, 16 const DisplayLayoutManager& layout_manager,
17 std::vector<DisplaySnapshot*>* hdcp_capable_displays) { 17 std::vector<DisplaySnapshot*>* hdcp_capable_displays) {
(...skipping 28 matching lines...) Expand all
46 DisplayLayoutManager* layout_manager, 46 DisplayLayoutManager* layout_manager,
47 NativeDisplayDelegate* native_display_delegate, 47 NativeDisplayDelegate* native_display_delegate,
48 const DisplayConfigurator::ContentProtections& requests, 48 const DisplayConfigurator::ContentProtections& requests,
49 const ResponseCallback& callback) 49 const ResponseCallback& callback)
50 : layout_manager_(layout_manager), 50 : layout_manager_(layout_manager),
51 native_display_delegate_(native_display_delegate), 51 native_display_delegate_(native_display_delegate),
52 requests_(requests), 52 requests_(requests),
53 callback_(callback), 53 callback_(callback),
54 query_status_(true), 54 query_status_(true),
55 pending_requests_(0), 55 pending_requests_(0),
56 weak_ptr_factory_(this) { 56 weak_ptr_factory_(this) {}
57 }
58 57
59 ApplyContentProtectionTask::~ApplyContentProtectionTask() { 58 ApplyContentProtectionTask::~ApplyContentProtectionTask() {}
60 }
61 59
62 void ApplyContentProtectionTask::Run() { 60 void ApplyContentProtectionTask::Run() {
63 std::vector<DisplaySnapshot*> hdcp_capable_displays; 61 std::vector<DisplaySnapshot*> hdcp_capable_displays;
64 if (!GetHDCPCapableDisplays(*layout_manager_, &hdcp_capable_displays)) { 62 if (!GetHDCPCapableDisplays(*layout_manager_, &hdcp_capable_displays)) {
65 callback_.Run(false); 63 callback_.Run(false);
66 return; 64 return;
67 } 65 }
68 66
69 pending_requests_ = hdcp_capable_displays.size(); 67 pending_requests_ = hdcp_capable_displays.size();
70 if (pending_requests_ == 0) { 68 if (pending_requests_ == 0) {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } else { 162 } else {
165 auto it = requests_.find(display_id); 163 auto it = requests_.find(display_id);
166 if (it != requests_.end()) 164 if (it != requests_.end())
167 desired_mask = it->second; 165 desired_mask = it->second;
168 } 166 }
169 167
170 return desired_mask; 168 return desired_mask;
171 } 169 }
172 170
173 } // namespace ui 171 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698