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

Unified Diff: ash/snap_to_pixel_layout_manager.cc

Issue 357063002: Snap widgets to pixel boundary on ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/snap_to_pixel_layout_manager.cc
diff --git a/ash/snap_to_pixel_layout_manager.cc b/ash/snap_to_pixel_layout_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..57d390a93284952d9c0bada1f9ffabb44c26776e
--- /dev/null
+++ b/ash/snap_to_pixel_layout_manager.cc
@@ -0,0 +1,45 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/snap_to_pixel_layout_manager.h"
+
+#include "ash/wm/window_properties.h"
+#include "ash/wm/window_util.h"
+#include "ui/aura/window.h"
+
+namespace ash {
+
+SnapToPixelLayoutManager::SnapToPixelLayoutManager(aura::Window* container) {
+ container->SetProperty(kSnapChildrenToPixelBoundary, true);
+}
+
+SnapToPixelLayoutManager::~SnapToPixelLayoutManager() {
+}
+
+void SnapToPixelLayoutManager::OnWindowResized() {
+}
+
+void SnapToPixelLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
+}
+
+void SnapToPixelLayoutManager::OnWillRemoveWindowFromLayout(
+ aura::Window* child) {
+}
+
+void SnapToPixelLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) {
+}
+
+void SnapToPixelLayoutManager::OnChildWindowVisibilityChanged(
+ aura::Window* child,
+ bool visibile) {
+}
+
+void SnapToPixelLayoutManager::SetChildBounds(
+ aura::Window* child,
+ const gfx::Rect& requested_bounds) {
+ SetChildBoundsDirect(child, requested_bounds);
+ wm::SnapWindowToPixelBoundary(child);
+}
+
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698