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

Unified Diff: ui/display/display_list.cc

Issue 2434923002: Handle modified displays in mustash. (Closed)
Patch Set: Fix PlatformScreenStub for tests. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/display/display_list.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/display_list.cc
diff --git a/ui/display/display_list.cc b/ui/display/display_list.cc
index 6aea752c1442e394374357f64843b4373f874e6a..ea78b1308f9b34815bf0316dcb6d59edd2515d4e 100644
--- a/ui/display/display_list.cc
+++ b/ui/display/display_list.cc
@@ -60,6 +60,10 @@ std::unique_ptr<DisplayListObserverLock> DisplayList::SuspendObserverUpdates() {
return base::WrapUnique(new DisplayListObserverLock(this));
}
+void DisplayList::UpdateDisplay(const display::Display& display) {
+ UpdateDisplay(display, GetTypeByDisplayId(display.id()));
+}
+
void DisplayList::UpdateDisplay(const display::Display& display, Type type) {
auto iter = FindDisplayById(display.id());
DCHECK(iter != displays_.end());
@@ -137,4 +141,12 @@ void DisplayList::DecrementObserverSuspendLockCount() {
observer_suspend_lock_count_--;
}
+DisplayList::Type DisplayList::GetTypeByDisplayId(int64_t display_id) const {
+ if (primary_display_index_ == -1)
+ return Type::NOT_PRIMARY;
+ return (displays_[primary_display_index_].id() == display_id
+ ? Type::PRIMARY
+ : Type::NOT_PRIMARY);
+}
+
} // namespace display
« no previous file with comments | « ui/display/display_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698