| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ASH_WM_STATUS_AREA_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_STATUS_AREA_LAYOUT_MANAGER_H_ |
| 6 #define ASH_WM_STATUS_AREA_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_STATUS_AREA_LAYOUT_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/aura/layout_manager.h" | 10 #include "ui/aura/layout_manager.h" |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 |
| 14 class ShelfWidget; |
| 13 namespace internal { | 15 namespace internal { |
| 14 | 16 |
| 15 class ShelfLayoutManager; | |
| 16 | |
| 17 // StatusAreaLayoutManager is a layout manager responsible for the status area. | 17 // StatusAreaLayoutManager is a layout manager responsible for the status area. |
| 18 // In any case when status area needs relayout it redirects this call to | 18 // In any case when status area needs relayout it redirects this call to |
| 19 // ShelfLayoutManager. | 19 // ShelfLayoutManager. |
| 20 class StatusAreaLayoutManager : public aura::LayoutManager { | 20 class StatusAreaLayoutManager : public aura::LayoutManager { |
| 21 public: | 21 public: |
| 22 explicit StatusAreaLayoutManager(ShelfLayoutManager* shelf); | 22 explicit StatusAreaLayoutManager(ShelfWidget* shelf); |
| 23 virtual ~StatusAreaLayoutManager(); | 23 virtual ~StatusAreaLayoutManager(); |
| 24 | 24 |
| 25 // Overridden from aura::LayoutManager: | 25 // Overridden from aura::LayoutManager: |
| 26 virtual void OnWindowResized() OVERRIDE; | 26 virtual void OnWindowResized() OVERRIDE; |
| 27 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; | 27 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; |
| 28 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; | 28 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; |
| 29 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE; | 29 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE; |
| 30 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | 30 virtual void OnChildWindowVisibilityChanged(aura::Window* child, |
| 31 bool visible) OVERRIDE; | 31 bool visible) OVERRIDE; |
| 32 virtual void SetChildBounds(aura::Window* child, | 32 virtual void SetChildBounds(aura::Window* child, |
| 33 const gfx::Rect& requested_bounds) OVERRIDE; | 33 const gfx::Rect& requested_bounds) OVERRIDE; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 // Updates layout of the status area. Effectively calls ShelfLayoutManager | 36 // Updates layout of the status area. Effectively calls ShelfLayoutManager |
| 37 // to update layout of the shelf. | 37 // to update layout of the shelf. |
| 38 void LayoutStatusArea(); | 38 void LayoutStatusArea(); |
| 39 | 39 |
| 40 // True when inside LayoutStatusArea method. | 40 // True when inside LayoutStatusArea method. |
| 41 // Used to prevent calling itself again from SetChildBounds(). | 41 // Used to prevent calling itself again from SetChildBounds(). |
| 42 bool in_layout_; | 42 bool in_layout_; |
| 43 | 43 |
| 44 ShelfLayoutManager* shelf_; | 44 ShelfWidget* shelf_; |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(StatusAreaLayoutManager); | 46 DISALLOW_COPY_AND_ASSIGN(StatusAreaLayoutManager); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace internal | 49 } // namespace internal |
| 50 } // namespace ash | 50 } // namespace ash |
| 51 | 51 |
| 52 #endif // ASH_WM_STATUS_AREA_LAYOUT_MANAGER_H_ | 52 #endif // ASH_WM_STATUS_AREA_LAYOUT_MANAGER_H_ |
| OLD | NEW |