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_COMMON_PANELS_PANEL_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_COMMON_PANELS_PANEL_LAYOUT_MANAGER_H_ |
6 #define ASH_WM_COMMON_PANELS_PANEL_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_COMMON_PANELS_PANEL_LAYOUT_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "ash/wm/common/ash_wm_common_export.h" | 11 #include "ash/ash_export.h" |
12 #include "ash/wm/common/shelf/wm_shelf_observer.h" | 12 #include "ash/wm/common/shelf/wm_shelf_observer.h" |
13 #include "ash/wm/common/window_state_observer.h" | 13 #include "ash/wm/common/window_state_observer.h" |
14 #include "ash/wm/common/wm_activation_observer.h" | 14 #include "ash/wm/common/wm_activation_observer.h" |
15 #include "ash/wm/common/wm_display_observer.h" | 15 #include "ash/wm/common/wm_display_observer.h" |
16 #include "ash/wm/common/wm_layout_manager.h" | 16 #include "ash/wm/common/wm_layout_manager.h" |
17 #include "ash/wm/common/wm_overview_mode_observer.h" | 17 #include "ash/wm/common/wm_overview_mode_observer.h" |
18 #include "ash/wm/common/wm_root_window_controller_observer.h" | 18 #include "ash/wm/common/wm_root_window_controller_observer.h" |
19 #include "ash/wm/common/wm_window_observer.h" | 19 #include "ash/wm/common/wm_window_observer.h" |
20 #include "ash/wm/common/wm_window_tracker.h" | 20 #include "ash/wm/common/wm_window_tracker.h" |
21 #include "base/compiler_specific.h" | 21 #include "base/compiler_specific.h" |
(...skipping 26 matching lines...) Expand all Loading... |
48 | 48 |
49 // PanelLayoutManager is responsible for organizing panels within the | 49 // PanelLayoutManager is responsible for organizing panels within the |
50 // workspace. It is associated with a specific container window (i.e. | 50 // workspace. It is associated with a specific container window (i.e. |
51 // kShellWindowId_PanelContainer) and controls the layout of any windows | 51 // kShellWindowId_PanelContainer) and controls the layout of any windows |
52 // added to that container. | 52 // added to that container. |
53 // | 53 // |
54 // The constructor takes a |panel_container| argument which is expected to set | 54 // The constructor takes a |panel_container| argument which is expected to set |
55 // its layout manager to this instance, e.g.: | 55 // its layout manager to this instance, e.g.: |
56 // panel_container->SetLayoutManager(new PanelLayoutManager(panel_container)); | 56 // panel_container->SetLayoutManager(new PanelLayoutManager(panel_container)); |
57 | 57 |
58 class ASH_WM_COMMON_EXPORT PanelLayoutManager | 58 class ASH_EXPORT PanelLayoutManager |
59 : public wm::WmLayoutManager, | 59 : public wm::WmLayoutManager, |
60 public wm::WindowStateObserver, | 60 public wm::WindowStateObserver, |
61 public wm::WmActivationObserver, | 61 public wm::WmActivationObserver, |
62 public wm::WmDisplayObserver, | 62 public wm::WmDisplayObserver, |
63 public wm::WmOverviewModeObserver, | 63 public wm::WmOverviewModeObserver, |
64 public wm::WmRootWindowControllerObserver, | 64 public wm::WmRootWindowControllerObserver, |
65 public wm::WmWindowObserver, | 65 public wm::WmWindowObserver, |
66 public keyboard::KeyboardControllerObserver, | 66 public keyboard::KeyboardControllerObserver, |
67 public wm::WmShelfObserver { | 67 public wm::WmShelfObserver { |
68 public: | 68 public: |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 private: | 128 private: |
129 friend class PanelLayoutManagerTest; | 129 friend class PanelLayoutManagerTest; |
130 friend class PanelWindowResizerTest; | 130 friend class PanelWindowResizerTest; |
131 friend class DockedWindowResizerTest; | 131 friend class DockedWindowResizerTest; |
132 friend class DockedWindowLayoutManagerTest; | 132 friend class DockedWindowLayoutManagerTest; |
133 friend class WorkspaceControllerTest; | 133 friend class WorkspaceControllerTest; |
134 friend class AcceleratorControllerTest; | 134 friend class AcceleratorControllerTest; |
135 | 135 |
136 views::Widget* CreateCalloutWidget(); | 136 views::Widget* CreateCalloutWidget(); |
137 | 137 |
138 struct ASH_WM_COMMON_EXPORT PanelInfo { | 138 struct ASH_EXPORT PanelInfo { |
139 PanelInfo() : window(NULL), callout_widget(NULL), slide_in(false) {} | 139 PanelInfo() : window(NULL), callout_widget(NULL), slide_in(false) {} |
140 | 140 |
141 bool operator==(const wm::WmWindow* other_window) const { | 141 bool operator==(const wm::WmWindow* other_window) const { |
142 return window == other_window; | 142 return window == other_window; |
143 } | 143 } |
144 | 144 |
145 // Returns |callout_widget| as a widget. Used by tests. | 145 // Returns |callout_widget| as a widget. Used by tests. |
146 views::Widget* CalloutWidget(); | 146 views::Widget* CalloutWidget(); |
147 | 147 |
148 // A weak pointer to the panel window. | 148 // A weak pointer to the panel window. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // are currently focused. | 204 // are currently focused. |
205 wm::WmWindow* last_active_panel_; | 205 wm::WmWindow* last_active_panel_; |
206 base::WeakPtrFactory<PanelLayoutManager> weak_factory_; | 206 base::WeakPtrFactory<PanelLayoutManager> weak_factory_; |
207 | 207 |
208 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); | 208 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); |
209 }; | 209 }; |
210 | 210 |
211 } // namespace ash | 211 } // namespace ash |
212 | 212 |
213 #endif // ASH_WM_COMMON_PANELS_PANEL_LAYOUT_MANAGER_H_ | 213 #endif // ASH_WM_COMMON_PANELS_PANEL_LAYOUT_MANAGER_H_ |
OLD | NEW |