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

Side by Side Diff: ash/aura/wm_shelf_aura.h

Issue 2247503002: mash: Create and show a shelf in mash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix WindowManager WmShell::Shutdown; delay PointerWatcherEventRouter teardown; cleanup shutdown wor… Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_AURA_WM_SHELF_AURA_H_ 5 #ifndef ASH_AURA_WM_SHELF_AURA_H_
6 #define ASH_AURA_WM_SHELF_AURA_H_ 6 #define ASH_AURA_WM_SHELF_AURA_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/common/shelf/shelf_icon_observer.h"
10 #include "ash/common/shelf/wm_shelf.h" 9 #include "ash/common/shelf/wm_shelf.h"
11 #include "ash/shelf/shelf_layout_manager_observer.h"
12 #include "base/macros.h" 10 #include "base/macros.h"
13 #include "base/observer_list.h"
14 11
15 namespace ash { 12 namespace ash {
16 13
17 class Shelf;
18 class ShelfBezelEventHandler; 14 class ShelfBezelEventHandler;
19 class ShelfLayoutManager;
20 15
21 // Aura implementation of WmShelf. 16 // Aura implementation of WmShelf.
22 class ASH_EXPORT WmShelfAura : public WmShelf, 17 class ASH_EXPORT WmShelfAura : public WmShelf {
23 public ShelfLayoutManagerObserver,
24 public ShelfIconObserver {
25 public: 18 public:
26 WmShelfAura(); 19 WmShelfAura();
27 ~WmShelfAura() override; 20 ~WmShelfAura() override;
28 21
29 // This object is initialized in multiple steps as the RootWindowController 22 // WmShelf:
30 // constructs the components of the shelf. 23 WmDimmerView* CreateDimmerView(bool disable_animations_for_test) override;
31 void SetShelfLayoutManager(ShelfLayoutManager* shelf_layout_manager); 24 void SetShelfLayoutManager(ShelfLayoutManager* manager) override;
32 void SetShelf(Shelf* shelf); 25 void WillDeleteShelfLayoutManager() override;
33 26 void WillChangeVisibilityState(ShelfVisibilityState new_state) override;
34 void Shutdown();
35
36 static Shelf* GetShelf(WmShelf* shelf);
37 27
38 private: 28 private:
39 class AutoHideEventHandler; 29 class AutoHideEventHandler;
40 30
41 void ResetShelfLayoutManager();
42
43 // WmShelf:
44 WmWindow* GetWindow() override;
45 ShelfAlignment GetAlignment() const override;
46 void SetAlignment(ShelfAlignment alignment) override;
47 ShelfAutoHideBehavior GetAutoHideBehavior() const override;
48 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior) override;
49 ShelfAutoHideState GetAutoHideState() const override;
50 void UpdateAutoHideState() override;
51 ShelfBackgroundType GetBackgroundType() const override;
52 WmDimmerView* CreateDimmerView(bool disable_animations_for_test) override;
53 bool IsDimmed() const override;
54 void SchedulePaint() override;
55 bool IsVisible() const override;
56 void UpdateVisibilityState() override;
57 ShelfVisibilityState GetVisibilityState() const override;
58 gfx::Rect GetIdealBounds() override;
59 gfx::Rect GetUserWorkAreaBounds() const override;
60 void UpdateIconPositionForWindow(WmWindow* window) override;
61 gfx::Rect GetScreenBoundsOfItemIconForWindow(WmWindow* window) override;
62 bool ProcessGestureEvent(const ui::GestureEvent& event) override;
63 void AddObserver(WmShelfObserver* observer) override;
64 void RemoveObserver(WmShelfObserver* observer) override;
65 void SetKeyboardBoundsForTesting(const gfx::Rect& bounds) override;
66 ShelfLockingManager* GetShelfLockingManagerForTesting() override;
67 ShelfView* GetShelfViewForTesting() override;
68
69 // ShelfLayoutManagerObserver:
70 void WillDeleteShelfLayoutManager() override;
71 void OnAutoHideStateChanged(ShelfAutoHideState new_state) override;
72 void OnBackgroundUpdated(ShelfBackgroundType background_type,
73 BackgroundAnimatorChangeType change_type) override;
74 void WillChangeVisibilityState(ShelfVisibilityState new_state) override;
75
76 // ShelfIconObserver:
77 void OnShelfIconPositionsChanged() override;
78
79 // May be null during login and during initialization of a secondary display.
80 Shelf* shelf_ = nullptr;
81
82 // Cached separately because it may be destroyed before |shelf_|.
83 ShelfLayoutManager* shelf_layout_manager_ = nullptr;
84
85 base::ObserverList<WmShelfObserver> observers_;
86
87 // Forwards mouse and gesture events to ShelfLayoutManager for auto-hide. 31 // Forwards mouse and gesture events to ShelfLayoutManager for auto-hide.
88 // TODO(mash): Facilitate simliar functionality in mash: crbug.com/631216 32 // TODO(mash): Facilitate simliar functionality in mash: crbug.com/631216
89 std::unique_ptr<AutoHideEventHandler> auto_hide_event_handler_; 33 std::unique_ptr<AutoHideEventHandler> auto_hide_event_handler_;
90 34
91 // Forwards touch gestures on a bezel sensor to the shelf. 35 // Forwards touch gestures on a bezel sensor to the shelf.
92 // TODO(mash): Facilitate simliar functionality in mash: crbug.com/636647 36 // TODO(mash): Facilitate simliar functionality in mash: crbug.com/636647
93 std::unique_ptr<ShelfBezelEventHandler> bezel_event_handler_; 37 std::unique_ptr<ShelfBezelEventHandler> bezel_event_handler_;
94 38
95 DISALLOW_COPY_AND_ASSIGN(WmShelfAura); 39 DISALLOW_COPY_AND_ASSIGN(WmShelfAura);
96 }; 40 };
97 41
98 } // namespace ash 42 } // namespace ash
99 43
100 #endif // ASH_AURA_WM_SHELF_AURA_H_ 44 #endif // ASH_AURA_WM_SHELF_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698