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

Unified Diff: ash/mus/test/wm_test_base.cc

Issue 2840043003: chromeos: Makes mushrome use simplified display management (Closed)
Patch Set: merge Created 3 years, 8 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 | « ash/mus/test/ash_test_impl_mus.cc ('k') | ash/mus/test/wm_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/test/wm_test_base.cc
diff --git a/ash/mus/test/wm_test_base.cc b/ash/mus/test/wm_test_base.cc
index a7776391a73e1ad2b981c072ade8dd5252c83226..eb0979fde201acb9403dec13f642dc4a8bceccf3 100644
--- a/ash/mus/test/wm_test_base.cc
+++ b/ash/mus/test/wm_test_base.cc
@@ -7,10 +7,12 @@
#include <algorithm>
#include <vector>
+#include "ash/display/window_tree_host_manager.h"
#include "ash/mus/test/wm_test_helper.h"
#include "ash/mus/top_level_window_factory.h"
#include "ash/mus/window_manager.h"
#include "ash/mus/window_manager_application.h"
+#include "ash/public/cpp/config.h"
#include "ash/public/cpp/session_types.h"
#include "ash/public/interfaces/session_controller.mojom.h"
#include "ash/session/session_controller.h"
@@ -23,6 +25,7 @@
#include "ui/aura/window.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/display/display.h"
+#include "ui/display/manager/display_manager.h"
namespace ash {
namespace mus {
@@ -73,19 +76,26 @@ void WmTestBase::UpdateDisplay(const std::string& display_spec) {
}
aura::Window* WmTestBase::GetPrimaryRootWindow() {
- std::vector<RootWindowController*> roots =
- test_helper_->GetRootsOrderedByDisplayId();
- DCHECK(!roots.empty());
- return roots[0]->GetRootWindow();
+ return Shell::Get()->GetPrimaryRootWindow();
}
aura::Window* WmTestBase::GetSecondaryRootWindow() {
+ if (Shell::GetAshConfig() == Config::MUS) {
+ return Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId(
+ GetSecondaryDisplay().id());
+ }
+
std::vector<RootWindowController*> roots =
test_helper_->GetRootsOrderedByDisplayId();
return roots.size() < 2 ? nullptr : roots[1]->GetRootWindow();
}
display::Display WmTestBase::GetPrimaryDisplay() {
+ if (Shell::GetAshConfig() == Config::MUS) {
+ return display::Screen::GetScreen()->GetDisplayNearestWindow(
+ Shell::Get()->GetPrimaryRootWindow());
+ }
+
std::vector<RootWindowController*> roots =
test_helper_->GetRootsOrderedByDisplayId();
DCHECK(!roots.empty());
@@ -93,6 +103,9 @@ display::Display WmTestBase::GetPrimaryDisplay() {
}
display::Display WmTestBase::GetSecondaryDisplay() {
+ if (Shell::GetAshConfig() == Config::MUS)
+ return Shell::Get()->display_manager()->GetSecondaryDisplay();
+
std::vector<RootWindowController*> roots =
test_helper_->GetRootsOrderedByDisplayId();
return roots.size() < 2 ? display::Display()
« no previous file with comments | « ash/mus/test/ash_test_impl_mus.cc ('k') | ash/mus/test/wm_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698