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

Side by Side Diff: ui/ozone/platform/dri/display_manager.cc

Issue 611423002: [WIP][Ozone] Support external touchscreens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ozone-touchscreen
Patch Set: . Created 6 years, 2 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
« no previous file with comments | « ui/ozone/platform/dri/display_manager.h ('k') | ui/ozone/platform/dri/dri.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "ui/ozone/platform/dri/display_manager.h"
6
7 #include "base/logging.h"
8 #include "ui/display/types/display_snapshot.h"
9
10 namespace ui {
11
12 DisplayManager::DisplayManager() {
13 }
14
15 DisplayManager::~DisplayManager() {
16 }
17
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.";
23 }
24
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();
32 }
33
34 DisplaySnapshot* DisplayManager::GetDisplay(int64_t display) {
35 DisplayMap::iterator it = display_map_.find(display);
36 if (it == display_map_.end())
37 return nullptr;
38
39 return it->second;
40 }
41
42 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/display_manager.h ('k') | ui/ozone/platform/dri/dri.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698