OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef ATHENA_COMMON_FILL_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_SNAP_TO_PIXEL_LAYOUT_MANAGER_H_ |
6 #define ATHENA_COMMON_FILL_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_SNAP_TO_PIXEL_LAYOUT_MANAGER_H_ |
7 | 7 |
8 #include "athena/athena_export.h" | 8 #include "base/macros.h" |
9 #include "ui/aura/layout_manager.h" | 9 #include "ui/aura/layout_manager.h" |
10 | 10 |
11 namespace athena { | 11 namespace gfx { |
| 12 class Point; |
| 13 } |
12 | 14 |
13 class ATHENA_EXPORT FillLayoutManager : public aura::LayoutManager { | 15 namespace ash { |
| 16 |
| 17 // A layout manager that places children's layer at the physical pixel |
| 18 // boundaries. |
| 19 class SnapToPixelLayoutManager : public aura::LayoutManager { |
14 public: | 20 public: |
15 explicit FillLayoutManager(aura::Window* container); | 21 explicit SnapToPixelLayoutManager(aura::Window* container); |
16 virtual ~FillLayoutManager(); | 22 virtual ~SnapToPixelLayoutManager(); |
17 | 23 |
18 // aura::LayoutManager: | 24 protected: |
| 25 // Overridden from aura::LayoutManager: |
19 virtual void OnWindowResized() OVERRIDE; | 26 virtual void OnWindowResized() OVERRIDE; |
20 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; | 27 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; |
21 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; | 28 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; |
22 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE; | 29 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE; |
23 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | 30 virtual void OnChildWindowVisibilityChanged(aura::Window* child, |
24 bool visible) OVERRIDE; | 31 bool visibile) OVERRIDE; |
25 virtual void SetChildBounds(aura::Window* child, | 32 virtual void SetChildBounds(aura::Window* child, |
26 const gfx::Rect& requested_bounds) OVERRIDE; | 33 const gfx::Rect& requested_bounds) OVERRIDE; |
27 | 34 |
28 private: | 35 private: |
29 aura::Window* container_; | 36 DISALLOW_COPY_AND_ASSIGN(SnapToPixelLayoutManager); |
30 | |
31 DISALLOW_COPY_AND_ASSIGN(FillLayoutManager); | |
32 }; | 37 }; |
33 | 38 |
34 } // namespace athena | 39 } // namespace ash |
35 | 40 |
36 #endif // ATHENA_COMMON_FILL_LAYOUT_MANAGER_H_ | 41 #endif // ASH_WM_SNAP_TO_PIXEL_LAYOUT_MANAGER_H_ |
OLD | NEW |