| 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_CONTROLLER_H_ | 5 #ifndef UI_AURA_SHELL_SHELF_LAYOUT_CONTROLLER_H_ |
| 6 #define UI_AURA_SHELL_SHELF_LAYOUT_CONTROLLER_H_ | 6 #define UI_AURA_SHELL_SHELF_LAYOUT_CONTROLLER_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" |
| 11 #include "ui/gfx/compositor/layer_animation_observer.h" | 11 #include "ui/gfx/compositor/layer_animation_observer.h" |
| 12 #include "ui/gfx/insets.h" | 12 #include "ui/gfx/insets.h" |
| 13 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 class Widget; | 16 class Widget; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace aura_shell { | 19 namespace aura_shell { |
| 20 namespace internal { | 20 namespace internal { |
| 21 | 21 |
| 22 // ShelfLayoutController is responsible for showing and hiding the launcher and | 22 // ShelfLayoutController is responsible for showing and hiding the launcher and |
| 23 // status area as well as positioning them. | 23 // status area as well as positioning them. |
| 24 class ShelfLayoutController : public ui::LayerAnimationObserver { | 24 class ShelfLayoutController : public ui::LayerAnimationObserver { |
| 25 public: | 25 public: |
| 26 ShelfLayoutController(views::Widget* launcher, | 26 ShelfLayoutController(views::Widget* launcher_widget, |
| 27 views::Widget* status); | 27 views::Widget* status_widget); |
| 28 virtual ~ShelfLayoutController(); | 28 virtual ~ShelfLayoutController(); |
| 29 | 29 |
| 30 views::Widget* status_widget() { return status_widget_; } |
| 31 |
| 30 // Stops any animations and sets the bounds of the launcher and status | 32 // Stops any animations and sets the bounds of the launcher and status |
| 31 // widgets. | 33 // widgets. |
| 32 void LayoutShelf(); | 34 void LayoutShelf(); |
| 33 | 35 |
| 34 // Sets the visbility of the shelf to |visible|. | 36 // Sets the visbility of the shelf to |visible|. |
| 35 void SetVisible(bool visible); | 37 void SetVisible(bool visible); |
| 36 | 38 |
| 37 private: | 39 private: |
| 38 struct TargetBounds { | 40 struct TargetBounds { |
| 39 gfx::Rect launcher_bounds; | 41 gfx::Rect launcher_bounds; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 64 // Are we animating? | 66 // Are we animating? |
| 65 bool animating_; | 67 bool animating_; |
| 66 | 68 |
| 67 // Current visibility. When the visibility changes this field is reset once | 69 // Current visibility. When the visibility changes this field is reset once |
| 68 // the animation completes. | 70 // the animation completes. |
| 69 bool visible_; | 71 bool visible_; |
| 70 | 72 |
| 71 // Max height needed. | 73 // Max height needed. |
| 72 int max_height_; | 74 int max_height_; |
| 73 | 75 |
| 74 views::Widget* launcher_; | 76 views::Widget* launcher_widget_; |
| 75 views::Widget* status_; | 77 views::Widget* status_widget_; |
| 76 | 78 |
| 77 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutController); | 79 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutController); |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 } // namespace internal | 82 } // namespace internal |
| 81 } // namespace aura_shell | 83 } // namespace aura_shell |
| 82 | 84 |
| 83 #endif // UI_AURA_SHELL_SHELF_LAYOUT_CONTROLLER_H_ | 85 #endif // UI_AURA_SHELL_SHELF_LAYOUT_CONTROLLER_H_ |
| OLD | NEW |