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

Side by Side Diff: ash/common/shelf/shelf_layout_manager.h

Issue 2736753005: Converts WmActivationObserver to aura::client::ActivationChangeObserver (Closed)
Patch Set: cleanup Created 3 years, 9 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_SHELF_SHELF_LAYOUT_MANAGER_H_ 5 #ifndef ASH_COMMON_SHELF_SHELF_LAYOUT_MANAGER_H_
6 #define ASH_COMMON_SHELF_SHELF_LAYOUT_MANAGER_H_ 6 #define ASH_COMMON_SHELF_SHELF_LAYOUT_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ash/common/session/session_state_observer.h" 11 #include "ash/common/session/session_state_observer.h"
12 #include "ash/common/shelf/wm_shelf.h" 12 #include "ash/common/shelf/wm_shelf.h"
13 #include "ash/common/shell_observer.h" 13 #include "ash/common/shell_observer.h"
14 #include "ash/common/wm/dock/docked_window_layout_manager_observer.h" 14 #include "ash/common/wm/dock/docked_window_layout_manager_observer.h"
15 #include "ash/common/wm/lock_state_observer.h" 15 #include "ash/common/wm/lock_state_observer.h"
16 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" 16 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h"
17 #include "ash/common/wm/workspace/workspace_types.h" 17 #include "ash/common/wm/workspace/workspace_types.h"
18 #include "ash/common/wm_activation_observer.h"
19 #include "ash/public/cpp/shelf_types.h" 18 #include "ash/public/cpp/shelf_types.h"
20 #include "base/macros.h" 19 #include "base/macros.h"
21 #include "base/observer_list.h" 20 #include "base/observer_list.h"
22 #include "base/timer/timer.h" 21 #include "base/timer/timer.h"
23 #include "ui/gfx/geometry/insets.h" 22 #include "ui/gfx/geometry/insets.h"
24 #include "ui/gfx/geometry/rect.h" 23 #include "ui/gfx/geometry/rect.h"
25 #include "ui/keyboard/keyboard_controller_observer.h" 24 #include "ui/keyboard/keyboard_controller_observer.h"
25 #include "ui/wm/public/activation_change_observer.h"
26 26
27 namespace ui { 27 namespace ui {
28 class ImplicitAnimationObserver; 28 class ImplicitAnimationObserver;
29 class MouseEvent; 29 class MouseEvent;
30 } 30 }
31 31
32 namespace ash { 32 namespace ash {
33 33
34 enum class AnimationChangeType; 34 enum class AnimationChangeType;
35 class PanelLayoutManagerTest; 35 class PanelLayoutManagerTest;
36 class ShelfLayoutManagerObserver; 36 class ShelfLayoutManagerObserver;
37 class ShelfLayoutManagerTest; 37 class ShelfLayoutManagerTest;
38 class ShelfWidget; 38 class ShelfWidget;
39 class WmShelf; 39 class WmShelf;
40 40
41 // ShelfLayoutManager is the layout manager responsible for the shelf and 41 // ShelfLayoutManager is the layout manager responsible for the shelf and
42 // status widgets. The shelf is given the total available width and told the 42 // status widgets. The shelf is given the total available width and told the
43 // width of the status area. This allows the shelf to draw the background and 43 // width of the status area. This allows the shelf to draw the background and
44 // layout to the status area. 44 // layout to the status area.
45 // To respond to bounds changes in the status area StatusAreaLayoutManager works 45 // To respond to bounds changes in the status area StatusAreaLayoutManager works
46 // closely with ShelfLayoutManager. 46 // closely with ShelfLayoutManager.
47 // On mus, widget bounds management is handled by the window manager. 47 // On mus, widget bounds management is handled by the window manager.
48 class ASH_EXPORT ShelfLayoutManager 48 class ASH_EXPORT ShelfLayoutManager
49 : public ShellObserver, 49 : public ShellObserver,
50 public WmActivationObserver, 50 public aura::client::ActivationChangeObserver,
51 public DockedWindowLayoutManagerObserver, 51 public DockedWindowLayoutManagerObserver,
52 public keyboard::KeyboardControllerObserver, 52 public keyboard::KeyboardControllerObserver,
53 public LockStateObserver, 53 public LockStateObserver,
54 public wm::WmSnapToPixelLayoutManager, 54 public wm::WmSnapToPixelLayoutManager,
55 public SessionStateObserver { 55 public SessionStateObserver {
56 public: 56 public:
57 ShelfLayoutManager(ShelfWidget* shelf_widget, WmShelf* wm_shelf); 57 ShelfLayoutManager(ShelfWidget* shelf_widget, WmShelf* wm_shelf);
58 ~ShelfLayoutManager() override; 58 ~ShelfLayoutManager() override;
59 59
60 bool updating_bounds() const { return updating_bounds_; } 60 bool updating_bounds() const { return updating_bounds_; }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 // Overridden from wm::WmSnapToPixelLayoutManager: 130 // Overridden from wm::WmSnapToPixelLayoutManager:
131 void OnWindowResized() override; 131 void OnWindowResized() override;
132 void SetChildBounds(WmWindow* child, 132 void SetChildBounds(WmWindow* child,
133 const gfx::Rect& requested_bounds) override; 133 const gfx::Rect& requested_bounds) override;
134 134
135 // Overridden from ShellObserver: 135 // Overridden from ShellObserver:
136 void OnShelfAutoHideBehaviorChanged(WmWindow* root_window) override; 136 void OnShelfAutoHideBehaviorChanged(WmWindow* root_window) override;
137 void OnPinnedStateChanged(WmWindow* pinned_window) override; 137 void OnPinnedStateChanged(WmWindow* pinned_window) override;
138 138
139 // Overridden from WmActivationObserver: 139 // Overridden from aura::client::ActivationChangeObserver:
140 void OnWindowActivated(WmWindow* gained_active, 140 void OnWindowActivated(ActivationReason reason,
141 WmWindow* lost_active) override; 141 aura::Window* gained_active,
142 aura::Window* lost_active) override;
142 143
143 // Overridden from keyboard::KeyboardControllerObserver: 144 // Overridden from keyboard::KeyboardControllerObserver:
144 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; 145 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override;
145 void OnKeyboardClosed() override; 146 void OnKeyboardClosed() override;
146 147
147 // Overridden from LockStateObserver: 148 // Overridden from LockStateObserver:
148 void OnLockStateEvent(LockStateObserver::EventType event) override; 149 void OnLockStateEvent(LockStateObserver::EventType event) override;
149 150
150 // Overridden from SessionStateObserver: 151 // Overridden from SessionStateObserver:
151 void SessionStateChanged(session_manager::SessionState state) override; 152 void SessionStateChanged(session_manager::SessionState state) override;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // The current shelf background. Should not be assigned to directly, use 357 // The current shelf background. Should not be assigned to directly, use
357 // MaybeUpdateShelfBackground() instead. 358 // MaybeUpdateShelfBackground() instead.
358 ShelfBackgroundType shelf_background_type_; 359 ShelfBackgroundType shelf_background_type_;
359 360
360 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager); 361 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager);
361 }; 362 };
362 363
363 } // namespace ash 364 } // namespace ash
364 365
365 #endif // ASH_COMMON_SHELF_SHELF_LAYOUT_MANAGER_H_ 366 #endif // ASH_COMMON_SHELF_SHELF_LAYOUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698