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 #include "ash/common/shelf/wm_shelf.h" | 5 #include "ash/common/shelf/wm_shelf.h" |
6 | 6 |
7 #include "ash/common/shelf/shelf_controller.h" | 7 #include "ash/common/shelf/shelf_controller.h" |
8 #include "ash/common/shelf/shelf_delegate.h" | 8 #include "ash/common/shelf/shelf_delegate.h" |
9 #include "ash/common/shelf/shelf_item_delegate.h" | 9 #include "ash/common/shelf/shelf_item_delegate.h" |
10 #include "ash/common/shelf/shelf_layout_manager.h" | 10 #include "ash/common/shelf/shelf_layout_manager.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) { | 161 alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) { |
162 shelf_locking_manager_->set_stored_alignment(alignment); | 162 shelf_locking_manager_->set_stored_alignment(alignment); |
163 return; | 163 return; |
164 } | 164 } |
165 | 165 |
166 alignment_ = alignment; | 166 alignment_ = alignment; |
167 // The ShelfWidget notifies the ShelfView of the alignment change. | 167 // The ShelfWidget notifies the ShelfView of the alignment change. |
168 shelf_widget_->OnShelfAlignmentChanged(); | 168 shelf_widget_->OnShelfAlignmentChanged(); |
169 shelf_layout_manager_->LayoutShelf(); | 169 shelf_layout_manager_->LayoutShelf(); |
170 WmShell::Get()->shelf_controller()->NotifyShelfAlignmentChanged(this); | 170 WmShell::Get()->shelf_controller()->NotifyShelfAlignmentChanged(this); |
171 WmShell::Get()->NotifyShelfAlignmentChanged(GetWindow()->GetRootWindow()); | 171 Shell::GetInstance()->NotifyShelfAlignmentChanged( |
| 172 GetWindow()->GetRootWindow()); |
172 } | 173 } |
173 | 174 |
174 bool WmShelf::IsHorizontalAlignment() const { | 175 bool WmShelf::IsHorizontalAlignment() const { |
175 switch (alignment_) { | 176 switch (alignment_) { |
176 case SHELF_ALIGNMENT_BOTTOM: | 177 case SHELF_ALIGNMENT_BOTTOM: |
177 case SHELF_ALIGNMENT_BOTTOM_LOCKED: | 178 case SHELF_ALIGNMENT_BOTTOM_LOCKED: |
178 return true; | 179 return true; |
179 case SHELF_ALIGNMENT_LEFT: | 180 case SHELF_ALIGNMENT_LEFT: |
180 case SHELF_ALIGNMENT_RIGHT: | 181 case SHELF_ALIGNMENT_RIGHT: |
181 return false; | 182 return false; |
(...skipping 23 matching lines...) Expand all Loading... |
205 } | 206 } |
206 | 207 |
207 void WmShelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) { | 208 void WmShelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) { |
208 DCHECK(shelf_layout_manager_); | 209 DCHECK(shelf_layout_manager_); |
209 | 210 |
210 if (auto_hide_behavior_ == auto_hide_behavior) | 211 if (auto_hide_behavior_ == auto_hide_behavior) |
211 return; | 212 return; |
212 | 213 |
213 auto_hide_behavior_ = auto_hide_behavior; | 214 auto_hide_behavior_ = auto_hide_behavior; |
214 WmShell::Get()->shelf_controller()->NotifyShelfAutoHideBehaviorChanged(this); | 215 WmShell::Get()->shelf_controller()->NotifyShelfAutoHideBehaviorChanged(this); |
215 WmShell::Get()->NotifyShelfAutoHideBehaviorChanged( | 216 Shell::GetInstance()->NotifyShelfAutoHideBehaviorChanged( |
216 GetWindow()->GetRootWindow()); | 217 GetWindow()->GetRootWindow()); |
217 } | 218 } |
218 | 219 |
219 ShelfAutoHideState WmShelf::GetAutoHideState() const { | 220 ShelfAutoHideState WmShelf::GetAutoHideState() const { |
220 return shelf_layout_manager_->auto_hide_state(); | 221 return shelf_layout_manager_->auto_hide_state(); |
221 } | 222 } |
222 | 223 |
223 void WmShelf::UpdateAutoHideState() { | 224 void WmShelf::UpdateAutoHideState() { |
224 shelf_layout_manager_->UpdateAutoHideState(); | 225 shelf_layout_manager_->UpdateAutoHideState(); |
225 } | 226 } |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 367 |
367 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, | 368 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, |
368 AnimationChangeType change_type) { | 369 AnimationChangeType change_type) { |
369 if (background_type == GetBackgroundType()) | 370 if (background_type == GetBackgroundType()) |
370 return; | 371 return; |
371 for (auto& observer : observers_) | 372 for (auto& observer : observers_) |
372 observer.OnBackgroundTypeChanged(background_type, change_type); | 373 observer.OnBackgroundTypeChanged(background_type, change_type); |
373 } | 374 } |
374 | 375 |
375 } // namespace ash | 376 } // namespace ash |
OLD | NEW |