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

Unified Diff: ui/display/display_list.cc

Issue 2314203002: Move DisplayList to display; add ScreenBase. (Closed)
Patch Set: Update unit test namespace. Created 4 years, 3 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') | ui/display/display_list_unittest.cc » ('j') | 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/views/mus/display_list.cc b/ui/display/display_list.cc
similarity index 93%
rename from ui/views/mus/display_list.cc
rename to ui/display/display_list.cc
index 5be844ca52f3043b3fdaa37f8882e8798d7c6c74..7b0f8d755ef94ffc9594c584b140e3964cd7de64 100644
--- a/ui/views/mus/display_list.cc
+++ b/ui/display/display_list.cc
@@ -2,12 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/views/mus/display_list.h"
+#include "ui/display/display_list.h"
-#include "ui/display/display_finder.h"
#include "ui/display/display_observer.h"
-namespace views {
+namespace display {
DisplayList::DisplayList() {}
@@ -93,8 +92,8 @@ void DisplayList::RemoveDisplay(int64_t id) {
auto iter = FindDisplayById(id);
DCHECK(displays_.end() != iter);
if (primary_display_index_ == static_cast<int>(iter - displays_.begin())) {
- // We expect the primary to change before removing it. The only case we
- // allow removal of the primary is if it is the list display.
+ // The primary display can only be removed if it is the last display.
+ // Users must choose a new primary before removing an old primary display.
DCHECK_EQ(1u, displays_.size());
primary_display_index_ = -1;
} else if (primary_display_index_ >
@@ -106,4 +105,4 @@ void DisplayList::RemoveDisplay(int64_t id) {
FOR_EACH_OBSERVER(display::DisplayObserver, observers_,
OnDisplayRemoved(display));
}
-} // namespace views
+} // namespace display
« no previous file with comments | « ui/display/display_list.h ('k') | ui/display/display_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698