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/wm/shelf/wm_shelf.h" | 9 #include "ash/common/shelf/wm_shelf.h" |
10 #include "ash/shelf/shelf_icon_observer.h" | 10 #include "ash/shelf/shelf_icon_observer.h" |
11 #include "ash/shelf/shelf_layout_manager_observer.h" | 11 #include "ash/shelf/shelf_layout_manager_observer.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 | 14 |
15 namespace ash { | 15 namespace ash { |
16 | 16 |
17 class Shelf; | 17 class Shelf; |
18 class ShelfLayoutManager; | 18 class ShelfLayoutManager; |
19 | 19 |
20 namespace wm { | |
21 | |
22 // Aura implementation of WmShelf. | 20 // Aura implementation of WmShelf. |
23 class ASH_EXPORT WmShelfAura : public WmShelf, | 21 class ASH_EXPORT WmShelfAura : public WmShelf, |
24 public ShelfLayoutManagerObserver, | 22 public ShelfLayoutManagerObserver, |
25 public ShelfIconObserver { | 23 public ShelfIconObserver { |
26 public: | 24 public: |
27 explicit WmShelfAura(Shelf* shelf); | 25 explicit WmShelfAura(Shelf* shelf); |
28 ~WmShelfAura() override; | 26 ~WmShelfAura() override; |
29 | 27 |
30 static Shelf* GetShelf(WmShelf* shelf); | 28 static Shelf* GetShelf(WmShelf* shelf); |
31 | 29 |
32 private: | 30 private: |
33 // WmShelf: | 31 // WmShelf: |
34 WmWindow* GetWindow() override; | 32 WmWindow* GetWindow() override; |
35 ShelfAlignment GetAlignment() const override; | 33 ShelfAlignment GetAlignment() const override; |
36 ShelfBackgroundType GetBackgroundType() const override; | 34 ShelfBackgroundType GetBackgroundType() const override; |
37 void UpdateVisibilityState() override; | 35 void UpdateVisibilityState() override; |
38 ShelfVisibilityState GetVisibilityState() const override; | 36 ShelfVisibilityState GetVisibilityState() const override; |
39 void UpdateIconPositionForWindow(WmWindow* window) override; | 37 void UpdateIconPositionForWindow(WmWindow* window) override; |
40 gfx::Rect GetScreenBoundsOfItemIconForWindow(WmWindow* window) override; | 38 gfx::Rect GetScreenBoundsOfItemIconForWindow(WmWindow* window) override; |
41 void AddObserver(WmShelfObserver* observer) override; | 39 void AddObserver(WmShelfObserver* observer) override; |
42 void RemoveObserver(WmShelfObserver* observer) override; | 40 void RemoveObserver(WmShelfObserver* observer) override; |
43 | 41 |
44 // ShelfLayoutManagerObserver: | 42 // ShelfLayoutManagerObserver: |
45 void WillDeleteShelfLayoutManager() override; | 43 void WillDeleteShelfLayoutManager() override; |
46 void OnBackgroundUpdated(wm::ShelfBackgroundType background_type, | 44 void OnBackgroundUpdated(ShelfBackgroundType background_type, |
47 BackgroundAnimatorChangeType change_type) override; | 45 BackgroundAnimatorChangeType change_type) override; |
48 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; | 46 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; |
49 | 47 |
50 // ShelfIconObserver: | 48 // ShelfIconObserver: |
51 void OnShelfIconPositionsChanged() override; | 49 void OnShelfIconPositionsChanged() override; |
52 | 50 |
53 Shelf* shelf_; | 51 Shelf* shelf_; |
54 base::ObserverList<WmShelfObserver> observers_; | 52 base::ObserverList<WmShelfObserver> observers_; |
55 // ShelfLayoutManager is cached separately as it may be destroyed before | 53 // ShelfLayoutManager is cached separately as it may be destroyed before |
56 // WmShelfAura. | 54 // WmShelfAura. |
57 ShelfLayoutManager* shelf_layout_manager_; | 55 ShelfLayoutManager* shelf_layout_manager_; |
58 | 56 |
59 DISALLOW_COPY_AND_ASSIGN(WmShelfAura); | 57 DISALLOW_COPY_AND_ASSIGN(WmShelfAura); |
60 }; | 58 }; |
61 | 59 |
62 } // namespace wm | |
63 } // namespace ash | 60 } // namespace ash |
64 | 61 |
65 #endif // ASH_AURA_WM_SHELF_AURA_H_ | 62 #endif // ASH_AURA_WM_SHELF_AURA_H_ |
OLD | NEW |