1 // Copyright 2014 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 #include "ui/ozone/platform/drm/host/display_manager.h"
7 #include "base/logging.h"
8 #include "ui/display/types/display_snapshot.h"
12 DisplayManager::DisplayManager() {
15 DisplayManager::~DisplayManager() {
18 void DisplayManager::RegisterDisplay(DisplaySnapshot
* display
) {
19 std::pair
<DisplayMap::iterator
, bool> result
= display_map_
.insert(
20 std::pair
<int64_t, DisplaySnapshot
*>(display
->display_id(), display
));
21 DCHECK(result
.second
) << "Display " << display
->display_id()
25 void DisplayManager::UnregisterDisplay(DisplaySnapshot
* display
) {
26 DisplayMap::iterator it
= display_map_
.find(display
->display_id());
27 if (it
!= display_map_
.end())
28 display_map_
.erase(it
);
30 NOTREACHED() << "Attempting to remove non-existing display "
31 << display
->display_id();
34 DisplaySnapshot
* DisplayManager::GetDisplay(int64_t display
) {
35 DisplayMap::iterator it
= display_map_
.find(display
);
36 if (it
== display_map_
.end())