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

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

Issue 2642003002: Removes ash::mus::RootWindowController (Closed)
Patch Set: feedback Created 3 years, 11 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
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 11786e96d494dce260fd1465a3f5274e095be7c2..251d90bc5125419cccb83aa2da2c1f19c98bf09c 100644
--- a/ash/mus/test/wm_test_base.cc
+++ b/ash/mus/test/wm_test_base.cc
@@ -9,8 +9,8 @@
#include "ash/common/session/session_controller.h"
#include "ash/common/wm_shell.h"
-#include "ash/mus/root_window_controller.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/session_types.h"
@@ -80,26 +80,27 @@ aura::Window* WmTestBase::GetPrimaryRootWindow() {
std::vector<RootWindowController*> roots =
test_helper_->GetRootsOrderedByDisplayId();
DCHECK(!roots.empty());
- return roots[0]->root();
+ return roots[0]->GetRootWindow();
}
aura::Window* WmTestBase::GetSecondaryRootWindow() {
std::vector<RootWindowController*> roots =
test_helper_->GetRootsOrderedByDisplayId();
- return roots.size() < 2 ? nullptr : roots[1]->root();
+ return roots.size() < 2 ? nullptr : roots[1]->GetRootWindow();
}
display::Display WmTestBase::GetPrimaryDisplay() {
std::vector<RootWindowController*> roots =
test_helper_->GetRootsOrderedByDisplayId();
DCHECK(!roots.empty());
- return roots[0]->display();
+ return roots[0]->GetWindow()->GetDisplayNearestWindow();
}
display::Display WmTestBase::GetSecondaryDisplay() {
std::vector<RootWindowController*> roots =
test_helper_->GetRootsOrderedByDisplayId();
- return roots.size() < 2 ? display::Display() : roots[1]->display();
+ return roots.size() < 2 ? display::Display()
+ : roots[1]->GetWindow()->GetDisplayNearestWindow();
}
aura::Window* WmTestBase::CreateTestWindow(const gfx::Rect& bounds) {
@@ -123,9 +124,10 @@ aura::Window* WmTestBase::CreateTestWindow(const gfx::Rect& bounds,
const ui::mojom::WindowType mus_window_type =
MusWindowTypeFromWmWindowType(window_type);
- aura::Window* window = test_helper_->GetRootsOrderedByDisplayId()[0]
- ->window_manager()
- ->NewTopLevelWindow(mus_window_type, &properties);
+ WindowManager* window_manager =
+ test_helper_->window_manager_app()->window_manager();
+ aura::Window* window = CreateAndParentTopLevelWindow(
+ window_manager, mus_window_type, &properties);
window->Show();
return window;
}
@@ -140,10 +142,10 @@ aura::Window* WmTestBase::CreateFullscreenTestWindow(int64_t display_id) {
properties[ui::mojom::WindowManager::kDisplayId_InitProperty] =
mojo::ConvertTo<std::vector<uint8_t>>(display_id);
}
- aura::Window* window =
- test_helper_->GetRootsOrderedByDisplayId()[0]
- ->window_manager()
- ->NewTopLevelWindow(ui::mojom::WindowType::WINDOW, &properties);
+ WindowManager* window_manager =
+ test_helper_->window_manager_app()->window_manager();
+ aura::Window* window = CreateAndParentTopLevelWindow(
+ window_manager, ui::mojom::WindowType::WINDOW, &properties);
window->Show();
return window;
}

Powered by Google App Engine
This is Rietveld 408576698