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

Side by Side Diff: ash/common/shelf/wm_shelf.h

Issue 2288993002: ash: Move AppList support to ShelfWidget, expose ShelfWidget in WmShelf (Closed)
Patch Set: missed one unit test Created 4 years, 3 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
« no previous file with comments | « ash/common/shelf/shelf_widget.cc ('k') | ash/common/shelf/wm_shelf.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 void SetShelf(Shelf* shelf); 43 void SetShelf(Shelf* shelf);
44 void ClearShelf(); 44 void ClearShelf();
45 Shelf* shelf() const { return shelf_; } 45 Shelf* shelf() const { return shelf_; }
46 46
47 virtual void SetShelfLayoutManager(ShelfLayoutManager* manager); 47 virtual void SetShelfLayoutManager(ShelfLayoutManager* manager);
48 ShelfLayoutManager* shelf_layout_manager() const { 48 ShelfLayoutManager* shelf_layout_manager() const {
49 return shelf_layout_manager_; 49 return shelf_layout_manager_;
50 } 50 }
51 51
52 ShelfWidget* shelf_widget() { return shelf_widget_; }
53
52 // Returns the window showing the shelf. 54 // Returns the window showing the shelf.
53 WmWindow* GetWindow(); 55 WmWindow* GetWindow();
54 56
55 ShelfAlignment alignment() const { return alignment_; } 57 ShelfAlignment alignment() const { return alignment_; }
56 // TODO(jamescook): Replace with alignment(). 58 // TODO(jamescook): Replace with alignment().
57 ShelfAlignment GetAlignment() const { return alignment_; } 59 ShelfAlignment GetAlignment() const { return alignment_; }
58 void SetAlignment(ShelfAlignment alignment); 60 void SetAlignment(ShelfAlignment alignment);
59 61
60 // Returns true if the shelf alignment is horizontal (i.e. at the bottom). 62 // Returns true if the shelf alignment is horizontal (i.e. at the bottom).
61 bool IsHorizontalAlignment() const; 63 bool IsHorizontalAlignment() const;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 128
127 void AddObserver(WmShelfObserver* observer); 129 void AddObserver(WmShelfObserver* observer);
128 void RemoveObserver(WmShelfObserver* observer); 130 void RemoveObserver(WmShelfObserver* observer);
129 131
130 void NotifyShelfIconPositionsChanged(); 132 void NotifyShelfIconPositionsChanged();
131 StatusAreaWidget* GetStatusAreaWidget() const; 133 StatusAreaWidget* GetStatusAreaWidget() const;
132 134
133 void SetVirtualKeyboardBoundsForTesting(const gfx::Rect& bounds); 135 void SetVirtualKeyboardBoundsForTesting(const gfx::Rect& bounds);
134 ShelfLockingManager* GetShelfLockingManagerForTesting(); 136 ShelfLockingManager* GetShelfLockingManagerForTesting();
135 ShelfView* GetShelfViewForTesting(); 137 ShelfView* GetShelfViewForTesting();
136 ShelfWidget* GetShelfWidgetForTesting();
137 138
138 protected: 139 protected:
139 WmShelf(); 140 WmShelf();
140 ~WmShelf() override; 141 ~WmShelf() override;
141 142
142 // ShelfLayoutManagerObserver: 143 // ShelfLayoutManagerObserver:
143 void WillDeleteShelfLayoutManager() override; 144 void WillDeleteShelfLayoutManager() override;
144 void WillChangeVisibilityState(ShelfVisibilityState new_state) override; 145 void WillChangeVisibilityState(ShelfVisibilityState new_state) override;
145 void OnAutoHideStateChanged(ShelfAutoHideState new_state) override; 146 void OnAutoHideStateChanged(ShelfAutoHideState new_state) override;
146 void OnBackgroundUpdated(ShelfBackgroundType background_type, 147 void OnBackgroundUpdated(ShelfBackgroundType background_type,
147 BackgroundAnimatorChangeType change_type) override; 148 BackgroundAnimatorChangeType change_type) override;
148 149
149 private: 150 private:
150 // Legacy shelf controller. Null before login and in secondary display init. 151 // Legacy shelf controller. Null before login and in secondary display init.
151 // Instance lifetimes are managed by ash::RootWindowController and WmShelfMus. 152 // Instance lifetimes are managed by ash::RootWindowController and WmShelfMus.
152 Shelf* shelf_ = nullptr; 153 Shelf* shelf_ = nullptr;
153 154
154 // Layout manager for the shelf container window. Instances are constructed by 155 // Layout manager for the shelf container window. Instances are constructed by
155 // ShelfWidget and lifetimes are managed by the container windows themselves. 156 // ShelfWidget and lifetimes are managed by the container windows themselves.
156 ShelfLayoutManager* shelf_layout_manager_ = nullptr; 157 ShelfLayoutManager* shelf_layout_manager_ = nullptr;
157 158
159 // TODO(jamescook): Move ShelfWidget ownership here.
160 ShelfWidget* shelf_widget_ = nullptr;
161
158 ShelfAlignment alignment_ = SHELF_ALIGNMENT_BOTTOM_LOCKED; 162 ShelfAlignment alignment_ = SHELF_ALIGNMENT_BOTTOM_LOCKED;
159 163
160 // Sets shelf alignment to bottom during login and screen lock. 164 // Sets shelf alignment to bottom during login and screen lock.
161 std::unique_ptr<ShelfLockingManager> shelf_locking_manager_; 165 std::unique_ptr<ShelfLockingManager> shelf_locking_manager_;
162 166
163 ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER; 167 ShelfAutoHideBehavior auto_hide_behavior_ = SHELF_AUTO_HIDE_BEHAVIOR_NEVER;
164 168
165 base::ObserverList<WmShelfObserver> observers_; 169 base::ObserverList<WmShelfObserver> observers_;
166 170
167 DISALLOW_COPY_AND_ASSIGN(WmShelf); 171 DISALLOW_COPY_AND_ASSIGN(WmShelf);
168 }; 172 };
169 173
170 } // namespace ash 174 } // namespace ash
171 175
172 #endif // ASH_COMMON_SHELF_WM_SHELF_H_ 176 #endif // ASH_COMMON_SHELF_WM_SHELF_H_
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_widget.cc ('k') | ash/common/shelf/wm_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698