| 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_COMMON_SHELF_WM_SHELF_H_ | 5 #ifndef ASH_COMMON_SHELF_WM_SHELF_H_ |
| 6 #define ASH_COMMON_SHELF_WM_SHELF_H_ | 6 #define ASH_COMMON_SHELF_WM_SHELF_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/shelf/shelf_layout_manager_observer.h" | 11 #include "ash/common/shelf/shelf_layout_manager_observer.h" |
| 12 #include "ash/public/cpp/shelf_types.h" | 12 #include "ash/public/cpp/shelf_types.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
| 17 class Rect; | 17 class Rect; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace ui { | 20 namespace ui { |
| 21 class GestureEvent; | 21 class GestureEvent; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace ash { | 24 namespace ash { |
| 25 | 25 |
| 26 class ShelfLayoutManager; | 26 class ShelfLayoutManager; |
| 27 class ShelfLayoutManagerTest; |
| 27 class ShelfLockingManager; | 28 class ShelfLockingManager; |
| 28 class ShelfView; | 29 class ShelfView; |
| 29 class ShelfWidget; | 30 class ShelfWidget; |
| 30 class StatusAreaWidget; | 31 class StatusAreaWidget; |
| 31 class WmShelfObserver; | 32 class WmShelfObserver; |
| 32 class WmWindow; | 33 class WmWindow; |
| 33 | 34 |
| 34 // Controller for the shelf state. Exists for the lifetime of each root window | 35 // Controller for the shelf state. Exists for the lifetime of each root window |
| 35 // controller. Note that the shelf widget may not be created until after login. | 36 // controller. Note that the shelf widget may not be created until after login. |
| 36 class ASH_EXPORT WmShelf : public ShelfLayoutManagerObserver { | 37 class ASH_EXPORT WmShelf : public ShelfLayoutManagerObserver { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 ~WmShelf() override; | 140 ~WmShelf() override; |
| 140 | 141 |
| 141 // ShelfLayoutManagerObserver: | 142 // ShelfLayoutManagerObserver: |
| 142 void WillDeleteShelfLayoutManager() override; | 143 void WillDeleteShelfLayoutManager() override; |
| 143 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; | 144 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; |
| 144 void OnAutoHideStateChanged(ShelfAutoHideState new_state) override; | 145 void OnAutoHideStateChanged(ShelfAutoHideState new_state) override; |
| 145 void OnBackgroundUpdated(ShelfBackgroundType background_type, | 146 void OnBackgroundUpdated(ShelfBackgroundType background_type, |
| 146 BackgroundAnimatorChangeType change_type) override; | 147 BackgroundAnimatorChangeType change_type) override; |
| 147 | 148 |
| 148 private: | 149 private: |
| 150 friend class ShelfLayoutManagerTest; |
| 151 |
| 149 // Layout manager for the shelf container window. Instances are constructed by | 152 // Layout manager for the shelf container window. Instances are constructed by |
| 150 // ShelfWidget and lifetimes are managed by the container windows themselves. | 153 // ShelfWidget and lifetimes are managed by the container windows themselves. |
| 151 ShelfLayoutManager* shelf_layout_manager_ = nullptr; | 154 ShelfLayoutManager* shelf_layout_manager_ = nullptr; |
| 152 | 155 |
| 153 std::unique_ptr<ShelfWidget> shelf_widget_; | 156 std::unique_ptr<ShelfWidget> shelf_widget_; |
| 154 | 157 |
| 155 // Internal implementation detail. Do not expose externally. Owned by views | 158 // Internal implementation detail. Do not expose externally. Owned by views |
| 156 // hierarchy. Null before login and in secondary display init. | 159 // hierarchy. Null before login and in secondary display init. |
| 157 ShelfView* shelf_view_ = nullptr; | 160 ShelfView* shelf_view_ = nullptr; |
| 158 | 161 |
| 159 ShelfAlignment alignment_ = SHELF_ALIGNMENT_BOTTOM_LOCKED; | 162 ShelfAlignment alignment_ = SHELF_ALIGNMENT_BOTTOM_LOCKED; |
| 160 | 163 |
| 161 // Sets shelf alignment to bottom during login and screen lock. | 164 // Sets shelf alignment to bottom during login and screen lock. |
| 162 std::unique_ptr<ShelfLockingManager> shelf_locking_manager_; | 165 std::unique_ptr<ShelfLockingManager> shelf_locking_manager_; |
| 163 | 166 |
| 164 ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER; | 167 ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER; |
| 165 | 168 |
| 166 base::ObserverList<WmShelfObserver> observers_; | 169 base::ObserverList<WmShelfObserver> observers_; |
| 167 | 170 |
| 168 // Temporary. Used to investigate http://crbug.com/665093 . | 171 // Temporary. Used to investigate http://crbug.com/665093 . |
| 169 base::TimeTicks time_last_auto_hide_change_; | 172 base::TimeTicks time_last_auto_hide_change_; |
| 170 int count_auto_hide_changes_ = 0; | 173 int count_auto_hide_changes_ = 0; |
| 171 | 174 |
| 172 DISALLOW_COPY_AND_ASSIGN(WmShelf); | 175 DISALLOW_COPY_AND_ASSIGN(WmShelf); |
| 173 }; | 176 }; |
| 174 | 177 |
| 175 } // namespace ash | 178 } // namespace ash |
| 176 | 179 |
| 177 #endif // ASH_COMMON_SHELF_WM_SHELF_H_ | 180 #endif // ASH_COMMON_SHELF_WM_SHELF_H_ |
| OLD | NEW |