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

Unified Diff: ash/wm/wm_snap_to_pixel_layout_manager.cc

Issue 2871813002: Converts remaining usage of WmLayoutManager to aura::LayoutManager (Closed)
Patch Set: cleanup 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/wm/wm_snap_to_pixel_layout_manager.h ('k') | ash/wm/workspace/workspace_layout_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/wm_snap_to_pixel_layout_manager.cc
diff --git a/ash/wm/wm_snap_to_pixel_layout_manager.cc b/ash/wm/wm_snap_to_pixel_layout_manager.cc
index a645cc8b3633243cc92209103e2fe96f99a85827..6eafdccf653eb8f95e7b5b67d00657cf60f5d26c 100644
--- a/ash/wm/wm_snap_to_pixel_layout_manager.cc
+++ b/ash/wm/wm_snap_to_pixel_layout_manager.cc
@@ -6,8 +6,7 @@
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/wm/window_properties.h"
-#include "ash/wm_window.h"
-#include "base/memory/ptr_util.h"
+#include "ash/wm/window_util.h"
#include "ui/aura/window.h"
namespace ash {
@@ -18,14 +17,14 @@ WmSnapToPixelLayoutManager::WmSnapToPixelLayoutManager() {}
WmSnapToPixelLayoutManager::~WmSnapToPixelLayoutManager() {}
// static
-void WmSnapToPixelLayoutManager::InstallOnContainers(WmWindow* window) {
- for (WmWindow* child : window->GetChildren()) {
- if (child->aura_window()->id() < kShellWindowId_Min ||
- child->aura_window()->id() > kShellWindowId_Max) // not a container
+void WmSnapToPixelLayoutManager::InstallOnContainers(aura::Window* window) {
+ for (aura::Window* child : window->children()) {
+ if (child->id() < kShellWindowId_Min ||
+ child->id() > kShellWindowId_Max) // not a container
continue;
- if (child->aura_window()->GetProperty(kSnapChildrenToPixelBoundary)) {
- if (!child->GetLayoutManager() && !child->aura_window()->layout_manager())
- child->SetLayoutManager(base::MakeUnique<WmSnapToPixelLayoutManager>());
+ if (child->GetProperty(kSnapChildrenToPixelBoundary)) {
+ if (!child->layout_manager())
+ child->SetLayoutManager(new WmSnapToPixelLayoutManager());
} else {
InstallOnContainers(child);
}
@@ -34,22 +33,23 @@ void WmSnapToPixelLayoutManager::InstallOnContainers(WmWindow* window) {
void WmSnapToPixelLayoutManager::OnWindowResized() {}
-void WmSnapToPixelLayoutManager::OnWindowAddedToLayout(WmWindow* child) {}
+void WmSnapToPixelLayoutManager::OnWindowAddedToLayout(aura::Window* child) {}
-void WmSnapToPixelLayoutManager::OnWillRemoveWindowFromLayout(WmWindow* child) {
-}
+void WmSnapToPixelLayoutManager::OnWillRemoveWindowFromLayout(
+ aura::Window* child) {}
-void WmSnapToPixelLayoutManager::OnWindowRemovedFromLayout(WmWindow* child) {}
+void WmSnapToPixelLayoutManager::OnWindowRemovedFromLayout(
+ aura::Window* child) {}
-void WmSnapToPixelLayoutManager::OnChildWindowVisibilityChanged(WmWindow* child,
- bool visibile) {
-}
+void WmSnapToPixelLayoutManager::OnChildWindowVisibilityChanged(
+ aura::Window* child,
+ bool visibile) {}
void WmSnapToPixelLayoutManager::SetChildBounds(
- WmWindow* child,
+ aura::Window* child,
const gfx::Rect& requested_bounds) {
- child->SetBoundsDirect(requested_bounds);
- child->SnapToPixelBoundaryIfNecessary();
+ SetChildBoundsDirect(child, requested_bounds);
+ wm::SnapWindowToPixelBoundary(child);
}
} // namespace wm
« no previous file with comments | « ash/wm/wm_snap_to_pixel_layout_manager.h ('k') | ash/wm/workspace/workspace_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698