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

Side by Side Diff: ash/wm/window_util.cc

Issue 2640243005: Align layers for ARC notification surface to pixels (Closed)
Patch Set: . 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 unified diff | Download patch
« no previous file with comments | « ash/wm/window_util.h ('k') | ui/arc/notification/arc_custom_notification_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/window_util.h" 5 #include "ash/wm/window_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/common/ash_constants.h" 9 #include "ash/common/ash_constants.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 if (!target_root || target_root == window->GetRootWindow()) 73 if (!target_root || target_root == window->GetRootWindow())
74 return false; 74 return false;
75 aura::Window* window_container = RootWindowController::ForWindow(target_root) 75 aura::Window* window_container = RootWindowController::ForWindow(target_root)
76 ->GetContainer(window->parent()->id()); 76 ->GetContainer(window->parent()->id());
77 // Move the window to the target launcher. 77 // Move the window to the target launcher.
78 window_container->AddChild(window); 78 window_container->AddChild(window);
79 return true; 79 return true;
80 } 80 }
81 81
82 void SnapWindowToPixelBoundary(aura::Window* window) { 82 void SnapWindowToPixelBoundary(aura::Window* window) {
83 window->SetProperty(kSnapChildrenToPixelBoundary, true);
83 aura::Window* snapped_ancestor = window->parent(); 84 aura::Window* snapped_ancestor = window->parent();
84 while (snapped_ancestor) { 85 while (snapped_ancestor) {
85 if (snapped_ancestor->GetProperty(kSnapChildrenToPixelBoundary)) { 86 if (snapped_ancestor->GetProperty(kSnapChildrenToPixelBoundary)) {
86 ui::SnapLayerToPhysicalPixelBoundary(snapped_ancestor->layer(), 87 ui::SnapLayerToPhysicalPixelBoundary(snapped_ancestor->layer(),
87 window->layer()); 88 window->layer());
88 return; 89 return;
89 } 90 }
90 snapped_ancestor = snapped_ancestor->parent(); 91 snapped_ancestor = snapped_ancestor->parent();
91 } 92 }
92 } 93 }
93 94
94 void SetSnapsChildrenToPhysicalPixelBoundary(aura::Window* container) { 95 void SetSnapsChildrenToPhysicalPixelBoundary(aura::Window* container) {
95 DCHECK(!container->GetProperty(kSnapChildrenToPixelBoundary)) 96 DCHECK(!container->GetProperty(kSnapChildrenToPixelBoundary))
96 << container->GetName(); 97 << container->GetName();
97 container->SetProperty(kSnapChildrenToPixelBoundary, true); 98 container->SetProperty(kSnapChildrenToPixelBoundary, true);
98 } 99 }
99 100
100 } // namespace wm 101 } // namespace wm
101 } // namespace ash 102 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_util.h ('k') | ui/arc/notification/arc_custom_notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698