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

Side by Side Diff: ui/display/manager/forwarding_display_delegate.cc

Issue 2901413004: chromeos: Fix handling of null in NativeDisplayDelegate (Closed)
Patch Set: Created 3 years, 6 months 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/manager/forwarding_display_delegate.h" 5 #include "ui/display/manager/forwarding_display_delegate.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "mojo/public/cpp/bindings/sync_call_restrictions.h" 10 #include "mojo/public/cpp/bindings/sync_call_restrictions.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 const DisplayMode* mode, 68 const DisplayMode* mode,
69 const gfx::Point& origin, 69 const gfx::Point& origin,
70 const ConfigureCallback& callback) { 70 const ConfigureCallback& callback) {
71 if (!use_delegate_) { 71 if (!use_delegate_) {
72 // Pretend configuration succeeded. When the first OnConfigurationChanged() 72 // Pretend configuration succeeded. When the first OnConfigurationChanged()
73 // is received this will run again and actually happen. 73 // is received this will run again and actually happen.
74 callback.Run(true); 74 callback.Run(true);
75 return; 75 return;
76 } 76 }
77 77
78 delegate_->Configure(snapshot.display_id(), mode->Clone(), origin, callback); 78 base::Optional<std::unique_ptr<DisplayMode>> transport_mode;
79 if (mode)
80 transport_mode = mode->Clone();
81 delegate_->Configure(snapshot.display_id(), std::move(transport_mode), origin,
82 callback);
79 } 83 }
80 84
81 void ForwardingDisplayDelegate::CreateFrameBuffer(const gfx::Size& size) {} 85 void ForwardingDisplayDelegate::CreateFrameBuffer(const gfx::Size& size) {}
82 86
83 void ForwardingDisplayDelegate::GetHDCPState( 87 void ForwardingDisplayDelegate::GetHDCPState(
84 const DisplaySnapshot& snapshot, 88 const DisplaySnapshot& snapshot,
85 const GetHDCPStateCallback& callback) { 89 const GetHDCPStateCallback& callback) {
86 delegate_->GetHDCPState(snapshot.display_id(), callback); 90 delegate_->GetHDCPState(snapshot.display_id(), callback);
87 } 91 }
88 92
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 156
153 void ForwardingDisplayDelegate::ForwardDisplays( 157 void ForwardingDisplayDelegate::ForwardDisplays(
154 const GetDisplaysCallback& callback) { 158 const GetDisplaysCallback& callback) {
155 std::vector<DisplaySnapshot*> snapshot_ptrs; 159 std::vector<DisplaySnapshot*> snapshot_ptrs;
156 for (auto& snapshot : snapshots_) 160 for (auto& snapshot : snapshots_)
157 snapshot_ptrs.push_back(snapshot.get()); 161 snapshot_ptrs.push_back(snapshot.get());
158 callback.Run(snapshot_ptrs); 162 callback.Run(snapshot_ptrs);
159 } 163 }
160 164
161 } // namespace display 165 } // namespace display
OLDNEW
« no previous file with comments | « services/ui/display/screen_manager_forwarding.cc ('k') | ui/display/mojo/native_display_delegate.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698