| OLD | NEW |
| 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* shelf_layout_manager) override; |
| 32 void SetShelf(Shelf* shelf); | 25 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; |
| 33 | |
| 34 void Shutdown(); | |
| 35 | |
| 36 static Shelf* GetShelf(WmShelf* shelf); | |
| 37 | 26 |
| 38 private: | 27 private: |
| 39 class AutoHideEventHandler; | 28 class AutoHideEventHandler; |
| 40 | 29 |
| 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. | 30 // Forwards mouse and gesture events to ShelfLayoutManager for auto-hide. |
| 88 // TODO(mash): Facilitate simliar functionality in mash: crbug.com/631216 | 31 // TODO(mash): Facilitate simliar functionality in mash: crbug.com/631216 |
| 89 std::unique_ptr<AutoHideEventHandler> auto_hide_event_handler_; | 32 std::unique_ptr<AutoHideEventHandler> auto_hide_event_handler_; |
| 90 | 33 |
| 91 // Forwards touch gestures on a bezel sensor to the shelf. | 34 // Forwards touch gestures on a bezel sensor to the shelf. |
| 92 // TODO(mash): Facilitate simliar functionality in mash: crbug.com/636647 | 35 // TODO(mash): Facilitate simliar functionality in mash: crbug.com/636647 |
| 93 std::unique_ptr<ShelfBezelEventHandler> bezel_event_handler_; | 36 std::unique_ptr<ShelfBezelEventHandler> bezel_event_handler_; |
| 94 | 37 |
| 95 DISALLOW_COPY_AND_ASSIGN(WmShelfAura); | 38 DISALLOW_COPY_AND_ASSIGN(WmShelfAura); |
| 96 }; | 39 }; |
| 97 | 40 |
| 98 } // namespace ash | 41 } // namespace ash |
| 99 | 42 |
| 100 #endif // ASH_AURA_WM_SHELF_AURA_H_ | 43 #endif // ASH_AURA_WM_SHELF_AURA_H_ |
| OLD | NEW |