Chromium Code Reviews| 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_PANEL_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_PANEL_LAYOUT_MANAGER_H_ |
| 6 #define ASH_WM_PANEL_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_PANEL_LAYOUT_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 | 10 |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "ash/launcher/launcher_icon_observer.h" | 12 #include "ash/launcher/launcher_icon_observer.h" |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/memory/scoped_ptr.h" | |
| 16 #include "base/memory/weak_ptr.h" | |
| 15 #include "ui/aura/layout_manager.h" | 17 #include "ui/aura/layout_manager.h" |
| 16 #include "ui/aura/window_observer.h" | 18 #include "ui/aura/window_observer.h" |
| 17 | 19 |
| 18 namespace aura { | 20 namespace aura { |
| 19 class Window; | 21 class Window; |
| 20 } | 22 } |
| 21 | 23 |
| 22 namespace gfx { | 24 namespace gfx { |
| 23 class Rect; | 25 class Rect; |
| 24 } | 26 } |
| 25 | 27 |
| 28 namespace views { | |
| 29 class Widget; | |
| 30 } | |
| 31 | |
| 26 namespace ash { | 32 namespace ash { |
| 27 class Launcher; | 33 class Launcher; |
| 28 | 34 |
| 29 namespace internal { | 35 namespace internal { |
| 30 | 36 |
| 31 // PanelLayoutManager is responsible for organizing panels within the | 37 // PanelLayoutManager is responsible for organizing panels within the |
| 32 // workspace. It is associated with a specific container window (i.e. | 38 // workspace. It is associated with a specific container window (i.e. |
| 33 // kShellWindowId_PanelContainer) and controls the layout of any windows | 39 // kShellWindowId_PanelContainer) and controls the layout of any windows |
| 34 // added to that container. | 40 // added to that container. |
| 35 // | 41 // |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 private: | 77 private: |
| 72 typedef std::list<aura::Window*> PanelList; | 78 typedef std::list<aura::Window*> PanelList; |
| 73 | 79 |
| 74 // Called whenever the panel layout might change. | 80 // Called whenever the panel layout might change. |
| 75 void Relayout(); | 81 void Relayout(); |
| 76 | 82 |
| 77 // Called whenever the panel stacking order needs to be updated (e.g. focus | 83 // Called whenever the panel stacking order needs to be updated (e.g. focus |
| 78 // changes or a panel is moved). | 84 // changes or a panel is moved). |
| 79 void UpdateStacking(aura::Window* active_panel); | 85 void UpdateStacking(aura::Window* active_panel); |
| 80 | 86 |
| 87 // Trigger a delayed task to update the callout. We use this because | |
| 88 // otherwise, ShadowController::OnWindowPropertyChanged may be invoked after | |
| 89 // we've already updated the callout, causing the drop shadow to be stacked on | |
| 90 // top of the callout rather than the other way around. | |
| 91 // TODO(dcheng): Possibly a bug in the shadow controller. If a window is | |
| 92 // focused but not stacked at the top, I don't think its shadow should be | |
| 93 // drawn on top of "higher" windows. | |
| 94 void UpdateCallout(aura::Window* active_window); | |
| 95 // Don't call this directly. Only UpdateCallout() should call this method. | |
|
sky
2012/04/27 15:42:42
nit: newline between 94/95. In fact typical style
| |
| 96 void ShowCalloutHelper(aura::Window* active_panel); | |
| 97 | |
| 81 // Parent window associated with this layout manager. | 98 // Parent window associated with this layout manager. |
| 82 aura::Window* panel_container_; | 99 aura::Window* panel_container_; |
| 83 // Protect against recursive calls to Relayout(). | 100 // Protect against recursive calls to Relayout(). |
| 84 bool in_layout_; | 101 bool in_layout_; |
| 85 // Ordered list of unowned pointers to panel windows. | 102 // Ordered list of unowned pointers to panel windows. |
| 86 PanelList panel_windows_; | 103 PanelList panel_windows_; |
| 87 // The panel being dragged. | 104 // The panel being dragged. |
| 88 aura::Window* dragged_panel_; | 105 aura::Window* dragged_panel_; |
| 89 // The launcher we are observing for launcher icon changes. | 106 // The launcher we are observing for launcher icon changes. |
| 90 Launcher* launcher_; | 107 Launcher* launcher_; |
| 91 // The last active panel. Used to maintain stacking even if no panels are | 108 // The last active panel. Used to maintain stacking even if no panels are |
| 92 // currently focused. | 109 // currently focused. |
| 93 aura::Window* last_active_panel_; | 110 aura::Window* last_active_panel_; |
| 111 // Manage the callout for the focused panel, if any. | |
| 112 scoped_ptr<views::Widget> callout_widget_; | |
| 113 base::WeakPtrFactory<PanelLayoutManager> weak_factory_; | |
| 94 | 114 |
| 95 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); | 115 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); |
| 96 }; | 116 }; |
| 97 | 117 |
| 98 } // namespace internal | 118 } // namespace internal |
| 99 } // namespace ash | 119 } // namespace ash |
| 100 | 120 |
| 101 #endif // ASH_WM_PANEL_LAYOUT_MANAGER_H_ | 121 #endif // ASH_WM_PANEL_LAYOUT_MANAGER_H_ |
| OLD | NEW |