| 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" | 9 #include "ash/common/shelf/shelf_icon_observer.h" |
| 10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // This object is initialized in multiple steps as the RootWindowController | 28 // This object is initialized in multiple steps as the RootWindowController |
| 29 // constructs the components of the shelf. | 29 // constructs the components of the shelf. |
| 30 void SetShelfLayoutManager(ShelfLayoutManager* shelf_layout_manager); | 30 void SetShelfLayoutManager(ShelfLayoutManager* shelf_layout_manager); |
| 31 void SetShelf(Shelf* shelf); | 31 void SetShelf(Shelf* shelf); |
| 32 | 32 |
| 33 void Shutdown(); | 33 void Shutdown(); |
| 34 | 34 |
| 35 static Shelf* GetShelf(WmShelf* shelf); | 35 static Shelf* GetShelf(WmShelf* shelf); |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 class AutoHideEventHandler; |
| 39 |
| 38 void ResetShelfLayoutManager(); | 40 void ResetShelfLayoutManager(); |
| 39 | 41 |
| 40 // WmShelf: | 42 // WmShelf: |
| 41 WmWindow* GetWindow() override; | 43 WmWindow* GetWindow() override; |
| 42 ShelfAlignment GetAlignment() const override; | 44 ShelfAlignment GetAlignment() const override; |
| 43 void SetAlignment(ShelfAlignment alignment) override; | 45 void SetAlignment(ShelfAlignment alignment) override; |
| 44 ShelfAutoHideBehavior GetAutoHideBehavior() const override; | 46 ShelfAutoHideBehavior GetAutoHideBehavior() const override; |
| 45 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior) override; | 47 void SetAutoHideBehavior(ShelfAutoHideBehavior behavior) override; |
| 46 ShelfAutoHideState GetAutoHideState() const override; | 48 ShelfAutoHideState GetAutoHideState() const override; |
| 47 void UpdateAutoHideState() override; | 49 void UpdateAutoHideState() override; |
| 48 ShelfBackgroundType GetBackgroundType() const override; | 50 ShelfBackgroundType GetBackgroundType() const override; |
| 49 bool IsDimmed() const override; | 51 bool IsDimmed() const override; |
| 50 bool IsShowingOverflowBubble() const override; | 52 bool IsShowingOverflowBubble() const override; |
| 51 void SchedulePaint() override; | 53 void SchedulePaint() override; |
| 52 bool IsVisible() const override; | 54 bool IsVisible() const override; |
| 53 void UpdateVisibilityState() override; | 55 void UpdateVisibilityState() override; |
| 54 ShelfVisibilityState GetVisibilityState() const override; | 56 ShelfVisibilityState GetVisibilityState() const override; |
| 55 gfx::Rect GetIdealBounds() override; | 57 gfx::Rect GetIdealBounds() override; |
| 56 gfx::Rect GetUserWorkAreaBounds() const override; | 58 gfx::Rect GetUserWorkAreaBounds() const override; |
| 57 void UpdateIconPositionForWindow(WmWindow* window) override; | 59 void UpdateIconPositionForWindow(WmWindow* window) override; |
| 58 gfx::Rect GetScreenBoundsOfItemIconForWindow(WmWindow* window) override; | 60 gfx::Rect GetScreenBoundsOfItemIconForWindow(WmWindow* window) override; |
| 59 bool ProcessGestureEvent(const ui::GestureEvent& event) override; | 61 bool ProcessGestureEvent(const ui::GestureEvent& event) override; |
| 60 void UpdateAutoHideForMouseEvent(ui::MouseEvent* event) override; | |
| 61 void UpdateAutoHideForGestureEvent(ui::GestureEvent* event) override; | |
| 62 void AddObserver(WmShelfObserver* observer) override; | 62 void AddObserver(WmShelfObserver* observer) override; |
| 63 void RemoveObserver(WmShelfObserver* observer) override; | 63 void RemoveObserver(WmShelfObserver* observer) override; |
| 64 void SetKeyboardBoundsForTesting(const gfx::Rect& bounds) override; | 64 void SetKeyboardBoundsForTesting(const gfx::Rect& bounds) override; |
| 65 ShelfLockingManager* GetShelfLockingManagerForTesting() override; | 65 ShelfLockingManager* GetShelfLockingManagerForTesting() override; |
| 66 ShelfView* GetShelfViewForTesting() override; | 66 ShelfView* GetShelfViewForTesting() override; |
| 67 | 67 |
| 68 // ShelfLayoutManagerObserver: | 68 // ShelfLayoutManagerObserver: |
| 69 void WillDeleteShelfLayoutManager() override; | 69 void WillDeleteShelfLayoutManager() override; |
| 70 void OnAutoHideStateChanged(ShelfAutoHideState new_state) override; | 70 void OnAutoHideStateChanged(ShelfAutoHideState new_state) override; |
| 71 void OnBackgroundUpdated(ShelfBackgroundType background_type, | 71 void OnBackgroundUpdated(ShelfBackgroundType background_type, |
| 72 BackgroundAnimatorChangeType change_type) override; | 72 BackgroundAnimatorChangeType change_type) override; |
| 73 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; | 73 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; |
| 74 | 74 |
| 75 // ShelfIconObserver: | 75 // ShelfIconObserver: |
| 76 void OnShelfIconPositionsChanged() override; | 76 void OnShelfIconPositionsChanged() override; |
| 77 | 77 |
| 78 // May be null during login and during initialization of a secondary display. | 78 // May be null during login and during initialization of a secondary display. |
| 79 Shelf* shelf_ = nullptr; | 79 Shelf* shelf_ = nullptr; |
| 80 | 80 |
| 81 // Cached separately because it may be destroyed before |shelf_|. | 81 // Cached separately because it may be destroyed before |shelf_|. |
| 82 ShelfLayoutManager* shelf_layout_manager_ = nullptr; | 82 ShelfLayoutManager* shelf_layout_manager_ = nullptr; |
| 83 | 83 |
| 84 base::ObserverList<WmShelfObserver> observers_; | 84 base::ObserverList<WmShelfObserver> observers_; |
| 85 | 85 |
| 86 // Forwards mouse and gesture events to ShelfLayoutManager for auto-hide. |
| 87 std::unique_ptr<AutoHideEventHandler> auto_hide_event_handler_; |
| 88 |
| 86 DISALLOW_COPY_AND_ASSIGN(WmShelfAura); | 89 DISALLOW_COPY_AND_ASSIGN(WmShelfAura); |
| 87 }; | 90 }; |
| 88 | 91 |
| 89 } // namespace ash | 92 } // namespace ash |
| 90 | 93 |
| 91 #endif // ASH_AURA_WM_SHELF_AURA_H_ | 94 #endif // ASH_AURA_WM_SHELF_AURA_H_ |
| OLD | NEW |