| 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/shelf.h" | 5 #include "ash/common/shelf/shelf.h" |
| 6 #include "ash/common/shelf/shelf_delegate.h" | 6 #include "ash/common/shelf/shelf_delegate.h" |
| 7 #include "ash/common/shelf/shelf_item_delegate.h" | 7 #include "ash/common/shelf/shelf_item_delegate.h" |
| 8 #include "ash/common/shelf/shelf_layout_manager.h" | 8 #include "ash/common/shelf/shelf_layout_manager.h" |
| 9 #include "ash/common/shelf/shelf_locking_manager.h" | 9 #include "ash/common/shelf/shelf_locking_manager.h" |
| 10 #include "ash/common/shelf/shelf_model.h" | 10 #include "ash/common/shelf/shelf_model.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 if (shelf_locking_manager_->is_locked() && | 67 if (shelf_locking_manager_->is_locked() && |
| 68 alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) { | 68 alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) { |
| 69 shelf_locking_manager_->set_stored_alignment(alignment); | 69 shelf_locking_manager_->set_stored_alignment(alignment); |
| 70 return; | 70 return; |
| 71 } | 71 } |
| 72 | 72 |
| 73 alignment_ = alignment; | 73 alignment_ = alignment; |
| 74 // The ShelfWidget notifies the ShelfView of the alignment change. | 74 // The ShelfWidget notifies the ShelfView of the alignment change. |
| 75 shelf_layout_manager_->shelf_widget()->OnShelfAlignmentChanged(); | 75 shelf_layout_manager_->shelf_widget()->OnShelfAlignmentChanged(); |
| 76 WmShell::Get()->shelf_delegate()->OnShelfAlignmentChanged(this); | 76 WmShell::Get()->shelf_delegate()->OnShelfAlignmentChanged(this); |
| 77 shelf_layout_manager_->LayoutShelf(); |
| 77 WmShell::Get()->NotifyShelfAlignmentChanged(GetWindow()->GetRootWindow()); | 78 WmShell::Get()->NotifyShelfAlignmentChanged(GetWindow()->GetRootWindow()); |
| 78 // ShelfLayoutManager will resize the shelf. | |
| 79 } | 79 } |
| 80 | 80 |
| 81 bool WmShelf::IsHorizontalAlignment() const { | 81 bool WmShelf::IsHorizontalAlignment() const { |
| 82 switch (alignment_) { | 82 switch (alignment_) { |
| 83 case SHELF_ALIGNMENT_BOTTOM: | 83 case SHELF_ALIGNMENT_BOTTOM: |
| 84 case SHELF_ALIGNMENT_BOTTOM_LOCKED: | 84 case SHELF_ALIGNMENT_BOTTOM_LOCKED: |
| 85 return true; | 85 return true; |
| 86 case SHELF_ALIGNMENT_LEFT: | 86 case SHELF_ALIGNMENT_LEFT: |
| 87 case SHELF_ALIGNMENT_RIGHT: | 87 case SHELF_ALIGNMENT_RIGHT: |
| 88 return false; | 88 return false; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, | 275 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, |
| 276 BackgroundAnimatorChangeType change_type) { | 276 BackgroundAnimatorChangeType change_type) { |
| 277 if (background_type == GetBackgroundType()) | 277 if (background_type == GetBackgroundType()) |
| 278 return; | 278 return; |
| 279 FOR_EACH_OBSERVER(WmShelfObserver, observers_, | 279 FOR_EACH_OBSERVER(WmShelfObserver, observers_, |
| 280 OnBackgroundTypeChanged(background_type, change_type)); | 280 OnBackgroundTypeChanged(background_type, change_type)); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace ash | 283 } // namespace ash |
| OLD | NEW |