Fix search results being clipped in app list.
[chromium-blink-merge.git] / ui / ozone / platform / drm / host / display_manager.cc
blobddf8163a56406c50a90c8d7301098ed524198c3e
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"
10 namespace ui {
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()
22 << " already added.";
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);
29 else
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())
37 return nullptr;
39 return it->second;
42 } // namespace ui