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

Unified Diff: ash/mus/test/wm_test_helper.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_helper.cc
diff --git a/ash/mus/test/wm_test_helper.cc b/ash/mus/test/wm_test_helper.cc
index 184bee180512f15e08ff37d132db3ca8a9a3ad8b..8bfb0e4f60cfb65207d940597087477b0e8db32a 100644
--- a/ash/mus/test/wm_test_helper.cc
+++ b/ash/mus/test/wm_test_helper.cc
@@ -9,7 +9,7 @@
#include "ash/common/test/test_system_tray_delegate.h"
#include "ash/common/test/wm_shell_test_api.h"
#include "ash/common/wm_shell.h"
-#include "ash/mus/root_window_controller.h"
+#include "ash/common/wm_window.h"
#include "ash/mus/screen_mus.h"
#include "ash/mus/window_manager.h"
#include "ash/mus/window_manager_application.h"
@@ -34,9 +34,10 @@ namespace ash {
namespace mus {
namespace {
-bool CompareByDisplayId(const RootWindowController* root1,
- const RootWindowController* root2) {
- return root1->display().id() < root2->display().id();
+bool CompareByDisplayId(RootWindowController* root1,
+ RootWindowController* root2) {
+ return root1->GetWindow()->GetDisplayNearestWindow().id() <
+ root2->GetWindow()->GetDisplayNearestWindow().id();
}
// TODO(sky): at some point this needs to support everything in DisplayInfo,
@@ -175,19 +176,19 @@ void WmTestHelper::UpdateDisplay(RootWindowController* root_window_controller,
gfx::Rect bounds = ParseDisplayBounds(display_spec);
bounds.set_x(*next_x);
*next_x += bounds.size().width();
- gfx::Insets work_area_insets =
- root_window_controller->display_.GetWorkAreaInsets();
- root_window_controller->display_.set_bounds(bounds);
- root_window_controller->display_.UpdateWorkAreaFromInsets(work_area_insets);
- root_window_controller->root()->SetBounds(gfx::Rect(bounds.size()));
+ display::Display updated_display =
+ root_window_controller->GetWindow()->GetDisplayNearestWindow();
+ gfx::Insets work_area_insets = updated_display.GetWorkAreaInsets();
+ updated_display.set_bounds(bounds);
+ updated_display.UpdateWorkAreaFromInsets(work_area_insets);
+ root_window_controller->GetWindow()->SetBounds(gfx::Rect(bounds.size()));
ScreenMus* screen = window_manager_app_->window_manager()->screen_.get();
- const bool is_primary = screen->display_list().FindDisplayById(
- root_window_controller->display().id()) ==
- screen->display_list().GetPrimaryDisplayIterator();
+ const bool is_primary =
+ screen->display_list().FindDisplayById(updated_display.id()) ==
+ screen->display_list().GetPrimaryDisplayIterator();
screen->display_list().UpdateDisplay(
- root_window_controller->display(),
- is_primary ? display::DisplayList::Type::PRIMARY
- : display::DisplayList::Type::NOT_PRIMARY);
+ updated_display, is_primary ? display::DisplayList::Type::PRIMARY
+ : display::DisplayList::Type::NOT_PRIMARY);
}
} // namespace mus

Powered by Google App Engine
This is Rietveld 408576698