| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 void WmShelf::DestroyShelfWidget() { | 126 void WmShelf::DestroyShelfWidget() { |
| 127 shelf_widget_.reset(); | 127 shelf_widget_.reset(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void WmShelf::CreateShelfView() { | 130 void WmShelf::CreateShelfView() { |
| 131 DCHECK(shelf_layout_manager_); | 131 DCHECK(shelf_layout_manager_); |
| 132 DCHECK(shelf_widget_); | 132 DCHECK(shelf_widget_); |
| 133 DCHECK(!shelf_view_); | 133 DCHECK(!shelf_view_); |
| 134 shelf_view_ = shelf_widget_->CreateShelfView(); | 134 shelf_view_ = shelf_widget_->CreateShelfView(); |
| 135 shelf_locking_manager_.reset(new ShelfLockingManager(this)); | 135 shelf_locking_manager_.reset(new ShelfLockingManager(this)); |
| 136 // When the shelf is created the alignment is unlocked. Chrome will update the | |
| 137 // alignment later from preferences. | |
| 138 alignment_ = SHELF_ALIGNMENT_BOTTOM; | |
| 139 WmShell::Get()->shelf_controller()->NotifyShelfCreated(this); | 136 WmShell::Get()->shelf_controller()->NotifyShelfCreated(this); |
| 140 } | 137 } |
| 141 | 138 |
| 142 void WmShelf::ShutdownShelf() { | 139 void WmShelf::ShutdownShelf() { |
| 143 DCHECK(shelf_view_); | 140 DCHECK(shelf_view_); |
| 144 shelf_locking_manager_.reset(); | 141 shelf_locking_manager_.reset(); |
| 145 shelf_view_ = nullptr; | 142 shelf_view_ = nullptr; |
| 146 } | 143 } |
| 147 | 144 |
| 148 bool WmShelf::IsShelfInitialized() const { | 145 bool WmShelf::IsShelfInitialized() const { |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 371 |
| 375 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, | 372 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, |
| 376 AnimationChangeType change_type) { | 373 AnimationChangeType change_type) { |
| 377 if (background_type == GetBackgroundType()) | 374 if (background_type == GetBackgroundType()) |
| 378 return; | 375 return; |
| 379 for (auto& observer : observers_) | 376 for (auto& observer : observers_) |
| 380 observer.OnBackgroundTypeChanged(background_type, change_type); | 377 observer.OnBackgroundTypeChanged(background_type, change_type); |
| 381 } | 378 } |
| 382 | 379 |
| 383 } // namespace ash | 380 } // namespace ash |
| OLD | NEW |