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 19 matching lines...) Expand all Loading... |
30 public: | 30 public: |
31 ShelfLayoutManager(views::Widget* launcher, views::Widget* status); | 31 ShelfLayoutManager(views::Widget* launcher, views::Widget* status); |
32 virtual ~ShelfLayoutManager(); | 32 virtual ~ShelfLayoutManager(); |
33 | 33 |
34 bool in_layout() const { return in_layout_; } | 34 bool in_layout() const { return in_layout_; } |
35 | 35 |
36 // Stops any animations and sets the bounds of the launcher and status | 36 // Stops any animations and sets the bounds of the launcher and status |
37 // widgets. | 37 // widgets. |
38 void LayoutShelf(); | 38 void LayoutShelf(); |
39 | 39 |
40 // Sets the visbility of the shelf to |visible|. | 40 // Sets the visibility of the shelf to |visible|. |
41 void SetVisible(bool visible); | 41 void SetVisible(bool visible); |
42 bool visible() const { return animating_ ? !visible_ : visible_; } | 42 bool visible() const { return animating_ ? !visible_ : visible_; } |
43 | 43 |
44 views::Widget* launcher() { return launcher_; } | 44 views::Widget* launcher() { return launcher_; } |
45 views::Widget* status() { return status_; } | 45 views::Widget* status() { return status_; } |
46 | 46 |
47 // See description above field. | 47 // See description above field. |
48 int max_height() const { return max_height_; } | 48 int max_height() const { return max_height_; } |
49 | 49 |
50 // Overridden from aura::LayoutManager: | 50 // Overridden from aura::LayoutManager: |
51 virtual void OnWindowResized() OVERRIDE; | 51 virtual void OnWindowResized() OVERRIDE; |
52 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; | 52 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; |
53 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; | 53 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; |
54 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | 54 virtual void OnChildWindowVisibilityChanged(aura::Window* child, |
55 bool visible) OVERRIDE; | 55 bool visible) OVERRIDE; |
56 virtual void SetChildBounds(aura::Window* child, | 56 virtual void SetChildBounds(aura::Window* child, |
57 const gfx::Rect& requested_bounds) OVERRIDE; | 57 const gfx::Rect& requested_bounds) OVERRIDE; |
58 | 58 |
59 private: | 59 private: |
60 struct TargetBounds { | 60 struct TargetBounds { |
61 gfx::Rect launcher_bounds; | 61 gfx::Rect launcher_bounds; |
62 gfx::Rect status_bounds; | 62 gfx::Rect status_bounds; |
63 gfx::Insets work_area_insets; | 63 gfx::Insets work_area_insets; |
64 }; | 64 }; |
65 | 65 |
66 // Stops any animations. | 66 // Stops any animations. |
67 void StopAnimating(); | 67 void StopAnimating(); |
68 | 68 |
69 // Calculates the target bounds assuming visibility of |visibile|. | 69 // Calculates the target bounds assuming visibility of |visible|. |
70 void CalculateTargetBounds(bool visible, | 70 void CalculateTargetBounds(bool visible, |
71 TargetBounds* target_bounds); | 71 TargetBounds* target_bounds); |
72 | 72 |
73 // Animates |widget| to the specified bounds and opacity. | 73 // Animates |widget| to the specified bounds and opacity. |
74 void AnimateWidgetTo(views::Widget* widget, | 74 void AnimateWidgetTo(views::Widget* widget, |
75 const gfx::Rect& target_bounds, | 75 const gfx::Rect& target_bounds, |
76 float target_opacity); | 76 float target_opacity); |
77 | 77 |
78 // LayerAnimationObserver overrides: | 78 // LayerAnimationObserver overrides: |
79 virtual void OnLayerAnimationEnded( | 79 virtual void OnLayerAnimationEnded( |
(...skipping 20 matching lines...) Expand all Loading... |
100 views::Widget* launcher_; | 100 views::Widget* launcher_; |
101 views::Widget* status_; | 101 views::Widget* status_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); | 103 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); |
104 }; | 104 }; |
105 | 105 |
106 } // namespace internal | 106 } // namespace internal |
107 } // namespace aura_shell | 107 } // namespace aura_shell |
108 | 108 |
109 #endif // UI_AURA_SHELL_SHELF_LAYOUT_MANAGER_H_ | 109 #endif // UI_AURA_SHELL_SHELF_LAYOUT_MANAGER_H_ |
OLD | NEW |