Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: ash/common/wm/panels/panel_layout_manager.h

Issue 2699033002: Replace WmWindowObserver with aura::WindowObserver. (Closed)
Patch Set: Check for null images in ShelfWindowWatcher. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ 5 #ifndef ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_
6 #define ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ 6 #define ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 10
11 #include "ash/ash_export.h" 11 #include "ash/ash_export.h"
12 #include "ash/common/shelf/wm_shelf_observer.h" 12 #include "ash/common/shelf/wm_shelf_observer.h"
13 #include "ash/common/shell_observer.h" 13 #include "ash/common/shell_observer.h"
14 #include "ash/common/wm/window_state_observer.h" 14 #include "ash/common/wm/window_state_observer.h"
15 #include "ash/common/wm_activation_observer.h" 15 #include "ash/common/wm_activation_observer.h"
16 #include "ash/common/wm_display_observer.h" 16 #include "ash/common/wm_display_observer.h"
17 #include "ash/common/wm_layout_manager.h" 17 #include "ash/common/wm_layout_manager.h"
18 #include "ash/common/wm_window_observer.h" 18 #include "ash/root_window_controller.h"
19 #include "ash/common/wm_window_tracker.h"
20 #include "base/compiler_specific.h" 19 #include "base/compiler_specific.h"
21 #include "base/macros.h" 20 #include "base/macros.h"
22 #include "base/memory/weak_ptr.h" 21 #include "base/memory/weak_ptr.h"
22 #include "ui/aura/window_observer.h"
23 #include "ui/aura/window_tracker.h"
23 #include "ui/keyboard/keyboard_controller.h" 24 #include "ui/keyboard/keyboard_controller.h"
24 #include "ui/keyboard/keyboard_controller_observer.h" 25 #include "ui/keyboard/keyboard_controller_observer.h"
25 26
26 namespace gfx { 27 namespace gfx {
27 class Rect; 28 class Rect;
28 } 29 }
29 30
30 namespace views { 31 namespace views {
31 class Widget; 32 class Widget;
32 } 33 }
(...skipping 14 matching lines...) Expand all
47 // The constructor takes a |panel_container| argument which is expected to set 48 // The constructor takes a |panel_container| argument which is expected to set
48 // its layout manager to this instance, e.g.: 49 // its layout manager to this instance, e.g.:
49 // panel_container->SetLayoutManager(new PanelLayoutManager(panel_container)); 50 // panel_container->SetLayoutManager(new PanelLayoutManager(panel_container));
50 51
51 class ASH_EXPORT PanelLayoutManager 52 class ASH_EXPORT PanelLayoutManager
52 : public WmLayoutManager, 53 : public WmLayoutManager,
53 public wm::WindowStateObserver, 54 public wm::WindowStateObserver,
54 public WmActivationObserver, 55 public WmActivationObserver,
55 public WmDisplayObserver, 56 public WmDisplayObserver,
56 public ShellObserver, 57 public ShellObserver,
57 public WmWindowObserver, 58 public aura::WindowObserver,
58 public keyboard::KeyboardControllerObserver, 59 public keyboard::KeyboardControllerObserver,
59 public WmShelfObserver { 60 public WmShelfObserver {
60 public: 61 public:
61 explicit PanelLayoutManager(WmWindow* panel_container); 62 explicit PanelLayoutManager(WmWindow* panel_container);
62 ~PanelLayoutManager() override; 63 ~PanelLayoutManager() override;
63 64
64 // Returns the PanelLayoutManager in the specified hierarchy. This searches 65 // Returns the PanelLayoutManager in the specified hierarchy. This searches
65 // from the root of |window|. 66 // from the root of |window|.
66 static PanelLayoutManager* Get(WmWindow* window); 67 static PanelLayoutManager* Get(WmWindow* window);
67 68
(...skipping 20 matching lines...) Expand all
88 void OnWillRemoveWindowFromLayout(WmWindow* child) override; 89 void OnWillRemoveWindowFromLayout(WmWindow* child) override;
89 void OnWindowRemovedFromLayout(WmWindow* child) override; 90 void OnWindowRemovedFromLayout(WmWindow* child) override;
90 void OnChildWindowVisibilityChanged(WmWindow* child, bool visibile) override; 91 void OnChildWindowVisibilityChanged(WmWindow* child, bool visibile) override;
91 void SetChildBounds(WmWindow* child, 92 void SetChildBounds(WmWindow* child,
92 const gfx::Rect& requested_bounds) override; 93 const gfx::Rect& requested_bounds) override;
93 94
94 // Overridden from ShellObserver: 95 // Overridden from ShellObserver:
95 void OnOverviewModeEnded() override; 96 void OnOverviewModeEnded() override;
96 void OnShelfAlignmentChanged(WmWindow* root_window) override; 97 void OnShelfAlignmentChanged(WmWindow* root_window) override;
97 98
98 // Overridden from WmWindowObserver 99 // Overridden from aura::WindowObserver
99 void OnWindowPropertyChanged(WmWindow* window, 100 void OnWindowPropertyChanged(aura::Window* window,
100 WmWindowProperty property) override; 101 const void* key,
102 intptr_t old) override;
101 103
102 // Overridden from wm::WindowStateObserver 104 // Overridden from wm::WindowStateObserver
103 void OnPostWindowStateTypeChange(wm::WindowState* window_state, 105 void OnPostWindowStateTypeChange(wm::WindowState* window_state,
104 wm::WindowStateType old_type) override; 106 wm::WindowStateType old_type) override;
105 107
106 // Overridden from WmActivationObserver 108 // Overridden from WmActivationObserver
107 void OnWindowActivated(WmWindow* gained_active, 109 void OnWindowActivated(WmWindow* gained_active,
108 WmWindow* lost_active) override; 110 WmWindow* lost_active) override;
109 111
110 // Overridden from WindowTreeHostManager::Observer 112 // Overridden from WindowTreeHostManager::Observer
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // Ordered list of unowned pointers to panel windows. 183 // Ordered list of unowned pointers to panel windows.
182 PanelList panel_windows_; 184 PanelList panel_windows_;
183 // The panel being dragged. 185 // The panel being dragged.
184 WmWindow* dragged_panel_; 186 WmWindow* dragged_panel_;
185 // The shelf we are observing for shelf icon changes. 187 // The shelf we are observing for shelf icon changes.
186 WmShelf* shelf_; 188 WmShelf* shelf_;
187 189
188 // When not NULL, the shelf is hidden (i.e. full screen) and this tracks the 190 // When not NULL, the shelf is hidden (i.e. full screen) and this tracks the
189 // set of panel windows which have been temporarily hidden and need to be 191 // set of panel windows which have been temporarily hidden and need to be
190 // restored when the shelf becomes visible again. 192 // restored when the shelf becomes visible again.
191 std::unique_ptr<WmWindowTracker> restore_windows_on_shelf_visible_; 193 std::unique_ptr<aura::WindowTracker> restore_windows_on_shelf_visible_;
192 194
193 // The last active panel. Used to maintain stacking order even if no panels 195 // The last active panel. Used to maintain stacking order even if no panels
194 // are currently focused. 196 // are currently focused.
195 WmWindow* last_active_panel_; 197 WmWindow* last_active_panel_;
196 base::WeakPtrFactory<PanelLayoutManager> weak_factory_; 198 base::WeakPtrFactory<PanelLayoutManager> weak_factory_;
197 199
198 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager); 200 DISALLOW_COPY_AND_ASSIGN(PanelLayoutManager);
199 }; 201 };
200 202
201 } // namespace ash 203 } // namespace ash
202 204
203 #endif // ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_ 205 #endif // ASH_COMMON_WM_PANELS_PANEL_LAYOUT_MANAGER_H_
OLDNEW
« no previous file with comments | « ash/common/wm/overview/window_selector_item.cc ('k') | ash/common/wm/panels/panel_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698