OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_AURA_SHELL_SHELF_LAYOUT_MANAGER_H_ | 5 #ifndef UI_AURA_SHELL_SHELF_LAYOUT_MANAGER_H_ |
6 #define UI_AURA_SHELL_SHELF_LAYOUT_MANAGER_H_ | 6 #define UI_AURA_SHELL_SHELF_LAYOUT_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 ShelfLayoutManager(views::Widget* launcher, | 29 ShelfLayoutManager(views::Widget* launcher, |
30 views::Widget* status); | 30 views::Widget* status); |
31 virtual ~ShelfLayoutManager(); | 31 virtual ~ShelfLayoutManager(); |
32 | 32 |
33 bool in_layout() const { return in_layout_; } | 33 bool in_layout() const { return in_layout_; } |
34 | 34 |
35 // Stops any animations and sets the bounds of the launcher and status | 35 // Stops any animations and sets the bounds of the launcher and status |
36 // widgets. | 36 // widgets. |
37 void LayoutShelf(); | 37 void LayoutShelf(); |
38 | 38 |
39 // Sets the visbility of the shelf to |visible|. | 39 // Sets the visibility of the shelf to |visible|. |
40 void SetVisible(bool visible); | 40 void SetVisible(bool visible); |
41 | 41 |
42 // Overridden from aura::LayoutManager: | 42 // Overridden from aura::LayoutManager: |
43 virtual void OnWindowResized() OVERRIDE; | 43 virtual void OnWindowResized() OVERRIDE; |
44 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; | 44 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; |
45 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; | 45 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; |
46 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | 46 virtual void OnChildWindowVisibilityChanged(aura::Window* child, |
47 bool visible) OVERRIDE; | 47 bool visible) OVERRIDE; |
48 virtual void SetChildBounds(aura::Window* child, | 48 virtual void SetChildBounds(aura::Window* child, |
49 const gfx::Rect& requested_bounds) OVERRIDE; | 49 const gfx::Rect& requested_bounds) OVERRIDE; |
50 | 50 |
51 private: | 51 private: |
52 struct TargetBounds { | 52 struct TargetBounds { |
53 gfx::Rect launcher_bounds; | 53 gfx::Rect launcher_bounds; |
54 gfx::Rect status_bounds; | 54 gfx::Rect status_bounds; |
55 gfx::Insets work_area_insets; | 55 gfx::Insets work_area_insets; |
56 }; | 56 }; |
57 | 57 |
58 // Stops any animations. | 58 // Stops any animations. |
59 void StopAnimating(); | 59 void StopAnimating(); |
60 | 60 |
61 // Calculates the target bounds assuming visibility of |visibile|. | 61 // Calculates the target bounds assuming visibility of |visible|. |
62 void CalculateTargetBounds(bool visible, | 62 void CalculateTargetBounds(bool visible, |
63 TargetBounds* target_bounds); | 63 TargetBounds* target_bounds); |
64 | 64 |
65 // Animates |widget| to the specified bounds and opacity. | 65 // Animates |widget| to the specified bounds and opacity. |
66 void AnimateWidgetTo(views::Widget* widget, | 66 void AnimateWidgetTo(views::Widget* widget, |
67 const gfx::Rect& target_bounds, | 67 const gfx::Rect& target_bounds, |
68 float target_opacity); | 68 float target_opacity); |
69 | 69 |
70 // LayerAnimationObserver overrides: | 70 // LayerAnimationObserver overrides: |
71 virtual void OnLayerAnimationEnded( | 71 virtual void OnLayerAnimationEnded( |
(...skipping 20 matching lines...) Expand all Loading... |
92 views::Widget* launcher_; | 92 views::Widget* launcher_; |
93 views::Widget* status_; | 93 views::Widget* status_; |
94 | 94 |
95 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 95 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
96 }; | 96 }; |
97 | 97 |
98 } // namespace internal | 98 } // namespace internal |
99 } // namespace aura_shell | 99 } // namespace aura_shell |
100 | 100 |
101 #endif // UI_AURA_SHELL_SHELF_LAYOUT_MANAGER_H_ | 101 #endif // UI_AURA_SHELL_SHELF_LAYOUT_MANAGER_H_ |
OLD | NEW |