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

Unified Diff: ash/mus/top_level_window_factory.cc

Issue 2908333003: [mus+ash] Removes WmWindow from ash (app_list, frame, metrics, session, system, wallpaper) (Closed)
Patch Set: [mus ash] Removes WmWindow from ash (rebase, nits and cleanup of use of ResizeHandleWindowTargeter) Created 3 years, 7 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/frame/detached_title_area_renderer.cc ('k') | ash/mus/window_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/top_level_window_factory.cc
diff --git a/ash/mus/top_level_window_factory.cc b/ash/mus/top_level_window_factory.cc
index 8149f63acc6f362078dd0c26fb06f5abef317f7f..639eb600d6a8606b0aee279ebd7e2facdf68583f 100644
--- a/ash/mus/top_level_window_factory.cc
+++ b/ash/mus/top_level_window_factory.cc
@@ -15,7 +15,6 @@
#include "ash/shell.h"
#include "ash/wm/container_finder.h"
#include "ash/wm/window_state.h"
-#include "ash/wm_window.h"
#include "mojo/public/cpp/bindings/type_converter.h"
#include "services/ui/public/cpp/property_type_converters.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
@@ -26,6 +25,7 @@
#include "ui/aura/mus/window_tree_client.h"
#include "ui/aura/window.h"
#include "ui/display/display.h"
+#include "ui/display/screen.h"
namespace ash {
namespace mus {
@@ -95,7 +95,8 @@ gfx::Rect CalculateDefaultBounds(
gfx::Rect bounds(root_size);
if (!container_window) {
const display::Display display =
- root_window_controller->GetWindow()->GetDisplayNearestWindow();
+ display::Screen::GetScreen()->GetDisplayNearestWindow(
+ root_window_controller->GetRootWindow());
bounds.Offset(display.bounds().OffsetFromOrigin());
}
return bounds;
@@ -178,13 +179,13 @@ aura::Window* CreateAndParentTopLevelWindowInRoot(
if (container_window) {
container_window->AddChild(window);
} else {
- WmWindow* root = root_window_controller->GetWindow();
- gfx::Point origin =
- root->ConvertPointToTarget(root->GetRootWindow(), gfx::Point());
- origin += root_window_controller->GetWindow()
- ->GetDisplayNearestWindow()
- .bounds()
- .OffsetFromOrigin();
+ aura::Window* root = root_window_controller->GetRootWindow();
+ gfx::Point origin;
+ aura::Window::ConvertPointToTarget(root, root->GetRootWindow(), &origin);
+ const display::Display display =
+ display::Screen::GetScreen()->GetDisplayNearestWindow(
+ root_window_controller->GetRootWindow());
+ origin += display.bounds().OffsetFromOrigin();
gfx::Rect bounds_in_screen(origin, bounds.size());
ash::wm::GetDefaultParent(window, bounds_in_screen)->AddChild(window);
}
@@ -206,7 +207,7 @@ aura::Window* CreateAndParentTopLevelWindow(
auto ignored_by_shelf_iter = properties->find(
ui::mojom::WindowManager::kWindowIgnoredByShelf_InitProperty);
if (ignored_by_shelf_iter != properties->end()) {
- wm::WindowState* window_state = WmWindow::Get(window)->GetWindowState();
+ wm::WindowState* window_state = wm::GetWindowState(window);
window_state->set_ignored_by_shelf(
mojo::ConvertTo<bool>(ignored_by_shelf_iter->second));
// No need to persist this value.
« no previous file with comments | « ash/mus/frame/detached_title_area_renderer.cc ('k') | ash/mus/window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698